model

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnknownRole = Role{}
	Destination = Role{"destination"}
	Source      = Role{"source"}
)
View Source
var (
	RouteAny    = RouteOption{"any"}
	RouteDirect = RouteOption{"direct"}
	RouteRelay  = RouteOption{"relay"}
)

Functions

func GenServerName

func GenServerName(prefix string) string

func PBFromForwards

func PBFromForwards(fwds []Forward) []*pb.Forward

Types

type Forward

type Forward struct {
	// contains filtered or unexported fields
}

func ForwardFromPB

func ForwardFromPB(f *pb.Forward) Forward

func NewForward

func NewForward(s string) Forward

func (Forward) MarshalText

func (f Forward) MarshalText() ([]byte, error)

func (Forward) PB

func (f Forward) PB() *pb.Forward

func (Forward) String

func (f Forward) String() string

func (*Forward) UnmarshalText

func (f *Forward) UnmarshalText(b []byte) error

type HostPort

type HostPort struct {
	Host string `json:"host"`
	Port uint16 `json:"port"`
}

func HostPortFromPB

func HostPortFromPB(h *pb.HostPort) HostPort

func (HostPort) PB

func (h HostPort) PB() *pb.HostPort

func (HostPort) String

func (h HostPort) String() string

type Role

type Role struct {
	// contains filtered or unexported fields
}

func RoleFromPB

func RoleFromPB(r pb.Role) Role

func (Role) Invert

func (r Role) Invert() Role

func (Role) MarshalText

func (r Role) MarshalText() ([]byte, error)

func (Role) PB

func (r Role) PB() pb.Role

func (Role) String

func (r Role) String() string

func (*Role) UnmarshalText

func (r *Role) UnmarshalText(b []byte) error

type RouteOption

type RouteOption struct {
	// contains filtered or unexported fields
}

func ParseRouteOption

func ParseRouteOption(s string) (RouteOption, error)

func (RouteOption) AllowDirect

func (r RouteOption) AllowDirect() bool

func (RouteOption) AllowFrom

func (r RouteOption) AllowFrom(from RouteOption) bool

func (RouteOption) AllowRelay

func (r RouteOption) AllowRelay() bool

Jump to

Keyboard shortcuts

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