sdk

package
v0.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ZrokProxyConfig = "zrok.proxy.v1"

Variables

This section is empty.

Functions

func DeleteAccess

func DeleteAccess(root env_core.Root, acc *Access) error

func DeleteShare

func DeleteShare(root env_core.Root, shr *Share) error

func NewDialer

func NewDialer(shrToken string, root env_core.Root) (edge.Conn, error)

func NewListener

func NewListener(shrToken string, root env_core.Root) (edge.Listener, error)

func NewListenerWithOptions

func NewListenerWithOptions(shrToken string, root env_core.Root, opts *ziti.ListenOptions) (edge.Listener, error)

Types

type Access

type Access struct {
	Token       string
	ShareToken  string
	BackendMode BackendMode
}

func CreateAccess

func CreateAccess(root env_core.Root, request *AccessRequest) (*Access, error)

type AccessRequest

type AccessRequest struct {
	ShareToken string
}

type AuthScheme

type AuthScheme string
const (
	None  AuthScheme = "none"
	Basic AuthScheme = "basic"
)

func ParseAuthScheme

func ParseAuthScheme(authScheme string) (AuthScheme, error)

type AuthUser

type AuthUser struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type BackendMode

type BackendMode string
const (
	ProxyBackendMode     BackendMode = "proxy"
	WebBackendMode       BackendMode = "web"
	TcpTunnelBackendMode BackendMode = "tcpTunnel"
	UdpTunnelBackendMode BackendMode = "udpTunnel"
	CaddyBackendMode     BackendMode = "caddy"
)

type BasicAuth

type BasicAuth struct {
	Users []*AuthUser `json:"users"`
}

type Metrics

type Metrics struct {
	Namespace string
	Sessions  map[string]SessionMetrics
}

type ProxyConfig

type ProxyConfig struct {
	AuthScheme AuthScheme `json:"auth_scheme"`
	BasicAuth  *BasicAuth `json:"basic_auth"`
}

type SessionMetrics

type SessionMetrics struct {
	BytesRead    int64
	BytesWritten int64
	LastUpdate   int64
}

type Share

type Share struct {
	Token             string
	FrontendEndpoints []string
}

func CreateShare

func CreateShare(root env_core.Root, request *ShareRequest) (*Share, error)

type ShareMode

type ShareMode string
const (
	PrivateShareMode ShareMode = "private"
	PublicShareMode  ShareMode = "public"
)

type ShareRequest

type ShareRequest struct {
	BackendMode BackendMode
	ShareMode   ShareMode
	Frontends   []string
	Auth        []string
	Target      string
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL