tunnelBackend/tunnelFrontend -> tcpTunnel (#170)

This commit is contained in:
Michael Quigley
2023-04-18 13:28:15 -04:00
parent 7c01f6d52a
commit 1a38aef26d
4 changed files with 14 additions and 14 deletions

View File

@ -1,4 +1,4 @@
package tunnelBackend
package tcpTunnel
import (
"github.com/openziti/sdk-golang/ziti"
@ -11,18 +11,18 @@ import (
"time"
)
type Config struct {
type BackendConfig struct {
IdentityPath string
EndpointAddress string
ShrToken string
}
type Backend struct {
cfg *Config
cfg *BackendConfig
listener edge.Listener
}
func New(cfg *Config) (*Backend, error) {
func NewBackend(cfg *BackendConfig) (*Backend, error) {
options := ziti.ListenOptions{
ConnectTimeout: 5 * time.Minute,
MaxConnections: 64,

View File

@ -1,4 +1,4 @@
package tunnelFrontend
package tcpTunnel
import (
"github.com/openziti/sdk-golang/ziti"
@ -12,20 +12,20 @@ import (
"io"
)
type Config struct {
type FrontendConfig struct {
BindAddress string
IdentityName string
ShrToken string
}
type Frontend struct {
cfg *Config
cfg *FrontendConfig
zCtx ziti.Context
listener transport.Address
closer io.Closer
}
func NewFrontend(cfg *Config) (*Frontend, error) {
func NewFrontend(cfg *FrontendConfig) (*Frontend, error) {
addr, err := transport.ParseAddress(cfg.BindAddress)
if err != nil {
return nil, errors.Wrapf(err, "error parsing '%v'", cfg.BindAddress)