Documentation ¶
Index ¶
- Constants
- Variables
- func GetLoggerFields(msg *channel2.Message) logrus.Fields
- func NewBindMsg(connId uint32, token string, pubKey []byte, options *ListenOptions) *channel2.Message
- func NewConnectMsg(connId uint32, token string, pubKey []byte, options *DialOptions) *channel2.Message
- func NewDataMsg(connId uint32, seq uint32, data []byte) *channel2.Message
- func NewDialFailedMsg(connId uint32, message string) *channel2.Message
- func NewDialMsg(connId uint32, token string, callerId string) *channel2.Message
- func NewDialSuccessMsg(connId uint32, newConnId uint32) *channel2.Message
- func NewHealthEventMsg(connId uint32, token string, pass bool) *channel2.Message
- func NewProbeMsg() *channel2.Message
- func NewStateClosedMsg(connId uint32, message string) *channel2.Message
- func NewStateConnectedMsg(connId uint32) *channel2.Message
- func NewStateSessionEndedMsg(reason string) *channel2.Message
- func NewUnbindMsg(connId uint32, token string) *channel2.Message
- func NewUpdateBindMsg(connId uint32, token string, cost *uint16, precedence *Precedence) *channel2.Message
- type Addr
- type ApiIdentity
- type ApiResponseMetadata
- type ApiSession
- type AsyncFunctionReceiveAdapter
- type AuthQuery
- type ChMsgMux
- func (mux *ChMsgMux) AddMsgSink(sink MsgSink) error
- func (mux *ChMsgMux) Close()
- func (mux *ChMsgMux) ContentType() int32
- func (mux *ChMsgMux) Event(event MuxEvent)
- func (mux *ChMsgMux) ExecuteClose()
- func (mux *ChMsgMux) GetNextId() uint32
- func (mux *ChMsgMux) HandleClose(_ channel2.Channel)
- func (mux *ChMsgMux) HandleReceive(msg *channel2.Message, _ channel2.Channel)
- func (mux *ChMsgMux) IsClosed() bool
- func (mux *ChMsgMux) RemoveMsgSink(sink MsgSink)
- func (mux *ChMsgMux) RemoveMsgSinkById(sinkId uint32)
- type CloseWriter
- type Conn
- type ConnOptions
- type CowMapMsgMux
- func (mux *CowMapMsgMux) AddMsgSink(sink MsgSink) error
- func (mux *CowMapMsgMux) Close()
- func (mux *CowMapMsgMux) ContentType() int32
- func (mux *CowMapMsgMux) GetNextId() uint32
- func (mux *CowMapMsgMux) HandleClose(channel2.Channel)
- func (mux *CowMapMsgMux) HandleReceive(msg *channel2.Message, ch channel2.Channel)
- func (mux *CowMapMsgMux) RemoveMsgSink(sink MsgSink)
- func (mux *CowMapMsgMux) RemoveMsgSinkById(sinkId uint32)
- type CryptoMethod
- type CurrentIdentity
- type DialOptions
- type DialResult
- type EdgeRouter
- type FunctionReceiveAdapter
- type Identifiable
- type ListenOptions
- type Listener
- type MsgChannel
- func (ec *MsgChannel) Id() uint32
- func (ec *MsgChannel) NextMsgId() uint32
- func (ec *MsgChannel) SendState(msg *channel2.Message) error
- func (ec *MsgChannel) SetWriteDeadline(t time.Time) error
- func (ec *MsgChannel) TraceMsg(source string, msg *channel2.Message)
- func (ec *MsgChannel) Write(data []byte) (n int, err error)
- func (ec *MsgChannel) WriteTraced(data []byte, msgUUID []byte, hdrs map[int32][]byte) (int, error)
- type MsgEvent
- type MsgMux
- type MsgSink
- type MuxEvent
- type PostureQueries
- type PostureQuery
- type PostureQueryProcess
- type Precedence
- type RouterClient
- type RouterConn
- type Sequenced
- type Service
- type ServiceConn
- type ServiceUpdates
- type Session
- type SessionListener
- type SessionType
- type Terminator
Constants ¶
View Source
const ( ContentTypeConnect = 60783 ContentTypeStateConnected = 60784 ContentTypeStateClosed = 60785 ContentTypeData = 60786 ContentTypeDial = 60787 ContentTypeDialSuccess = 60788 ContentTypeDialFailed = 60789 ContentTypeBind = 60790 ContentTypeUnbind = 60791 ContentTypeStateSessionEnded = 60792 ContentTypeProbe = 60793 ContentTypeUpdateBind = 60794 ContentTypeHealthEvent = 60795 ConnIdHeader = 1000 SeqHeader = 1001 SessionTokenHeader = 1002 PublicKeyHeader = 1003 CostHeader = 1004 PrecedenceHeader = 1005 TerminatorIdentityHeader = 1006 TerminatorIdentitySecretHeader = 1007 CallerIdHeader = 1008 CryptoMethodHeader = 1009 FlagsHeader = 1010 AppDataHeader = 1011 RouterProvidedConnId = 1012 HealthStatusHeader = 1013 ErrorCodeHeader = 1014 ErrorCodeInternal = 1 ErrorCodeInvalidApiSession = 2 ErrorCodeInvalidSession = 3 ErrorCodeWrongSessionType = 4 ErrorCodeInvalidEdgeRouterForSession = 5 ErrorCodeInvalidService = 6 ErrorCodeTunnelingNotEnabled = 7 ErrorCodeInvalidTerminator = 8 ErrorCodeInvalidPrecedence = 9 ErrorCodeInvalidCost = 10 ErrorCodeEncryptionDataMissing = 11 PrecedenceDefault Precedence = 0 PrecedenceRequired = 1 PrecedenceFailed = 2 // Put this in the reflected range so replies will share the same UUID UUIDHeader = 128 // Crypto Methods CryptoMethodLibsodium CryptoMethod = 0 // default: crypto_kx_*, crypto_secretstream_* CryptoMethodSSL = 1 // OpenSSL(possibly with FIPS): ECDH, AES256-GCM // Edge Payload flags FIN = 0x1 )
Variables ¶
View Source
var ContentTypeNames = map[int32]string{ ContentTypeConnect: "EdgeConnectType", ContentTypeStateConnected: "EdgeStateConnectedType", ContentTypeStateClosed: "EdgeStateClosedType", ContentTypeData: "EdgeDataType", ContentTypeDial: "EdgeDialType", ContentTypeDialSuccess: "EdgeDialSuccessType", ContentTypeDialFailed: "EdgeDialFailedType", ContentTypeBind: "EdgeBindType", ContentTypeUnbind: "EdgeUnbindType", ContentTypeProbe: "EdgeProbeType", }
View Source
var ContentTypeValue = map[string]int32{ "EdgeConnectType": ContentTypeConnect, "EdgeStateConnectedType": ContentTypeStateConnected, "EdgeStateClosedType": ContentTypeStateClosed, "EdgeDataType": ContentTypeData, "EdgeDialType": ContentTypeDial, "EdgeDialSuccessType": ContentTypeDialSuccess, "EdgeDialFailedType": ContentTypeDialFailed, "EdgeBindType": ContentTypeBind, "EdgeUnbindType": ContentTypeUnbind, }
Functions ¶
func NewBindMsg ¶
func NewConnectMsg ¶
func NewHealthEventMsg ¶ added in v0.15.30
func NewProbeMsg ¶
func NewStateConnectedMsg ¶
func NewStateSessionEndedMsg ¶
func NewUpdateBindMsg ¶
Types ¶
type Addr ¶
type Addr struct {
MsgCh MsgChannel
}
type ApiIdentity ¶
type ApiResponseMetadata ¶
type ApiResponseMetadata struct { FilterableFields []string `json:"filterableFields"` Pagination *struct { Offset int `json:"offset"` Limit int `json:"limit"` TotalCount int `json:"totalCount"` } `json:"pagination"` }
func ApiResponseDecode ¶
func ApiResponseDecode(data interface{}, resp io.Reader) (*ApiResponseMetadata, error)
type ApiSession ¶
type AsyncFunctionReceiveAdapter ¶
type AsyncFunctionReceiveAdapter struct { Type int32 Handler func(*channel2.Message, channel2.Channel) }
func (*AsyncFunctionReceiveAdapter) ContentType ¶
func (adapter *AsyncFunctionReceiveAdapter) ContentType() int32
func (*AsyncFunctionReceiveAdapter) HandleReceive ¶
func (adapter *AsyncFunctionReceiveAdapter) HandleReceive(m *channel2.Message, ch channel2.Channel)
type ChMsgMux ¶ added in v0.15.0
type ChMsgMux struct {
// contains filtered or unexported fields
}
func NewChMsgMux ¶ added in v0.15.0
func NewChMsgMux() *ChMsgMux
func (*ChMsgMux) AddMsgSink ¶ added in v0.15.0
func (*ChMsgMux) ContentType ¶ added in v0.15.0
func (*ChMsgMux) ExecuteClose ¶ added in v0.15.0
func (mux *ChMsgMux) ExecuteClose()
func (*ChMsgMux) HandleClose ¶ added in v0.15.0
func (*ChMsgMux) HandleReceive ¶ added in v0.15.0
func (*ChMsgMux) RemoveMsgSink ¶ added in v0.15.0
func (*ChMsgMux) RemoveMsgSinkById ¶ added in v0.15.0
type CloseWriter ¶ added in v0.14.0
type CloseWriter interface {
CloseWrite() error
}
type Conn ¶
type Conn interface { ServiceConn Identifiable CompleteAcceptSuccess() error CompleteAcceptFailed(err error) }
type ConnOptions ¶
type CowMapMsgMux ¶ added in v0.15.0
func (*CowMapMsgMux) AddMsgSink ¶ added in v0.15.0
func (mux *CowMapMsgMux) AddMsgSink(sink MsgSink) error
func (*CowMapMsgMux) Close ¶ added in v0.15.0
func (mux *CowMapMsgMux) Close()
func (*CowMapMsgMux) ContentType ¶ added in v0.15.0
func (mux *CowMapMsgMux) ContentType() int32
func (*CowMapMsgMux) GetNextId ¶ added in v0.15.2
func (mux *CowMapMsgMux) GetNextId() uint32
func (*CowMapMsgMux) HandleClose ¶ added in v0.15.0
func (mux *CowMapMsgMux) HandleClose(channel2.Channel)
func (*CowMapMsgMux) HandleReceive ¶ added in v0.15.0
func (mux *CowMapMsgMux) HandleReceive(msg *channel2.Message, ch channel2.Channel)
func (*CowMapMsgMux) RemoveMsgSink ¶ added in v0.15.0
func (mux *CowMapMsgMux) RemoveMsgSink(sink MsgSink)
func (*CowMapMsgMux) RemoveMsgSinkById ¶ added in v0.15.0
func (mux *CowMapMsgMux) RemoveMsgSinkById(sinkId uint32)
type CryptoMethod ¶ added in v0.13.55
type CryptoMethod byte
type CurrentIdentity ¶ added in v0.15.3
type CurrentIdentity struct { Id string `json:"id"` Name string `json:"name"` AppData map[string]interface{} `json:"appData"` DefaultHostingPrecedence string `json:"defaultHostingPrecedence"` DefaultHostingCost uint16 `json:"defaultHostingCost"` ServiceHostingPrecedences map[string]interface{} `json:"serviceHostingPrecedences"` ServiceHostingCosts map[string]interface{} `json:"serviceHostingCosts"` }
type DialOptions ¶ added in v0.13.47
type DialOptions struct { ConnectTimeout time.Duration Identity string CallerId string AppData []byte }
func (DialOptions) GetConnectTimeout ¶ added in v0.13.47
func (d DialOptions) GetConnectTimeout() time.Duration
type DialResult ¶
func UnmarshalDialResult ¶
func UnmarshalDialResult(msg *channel2.Message) (*DialResult, error)
type EdgeRouter ¶
type FunctionReceiveAdapter ¶
func (*FunctionReceiveAdapter) ContentType ¶
func (adapter *FunctionReceiveAdapter) ContentType() int32
func (*FunctionReceiveAdapter) HandleReceive ¶
func (adapter *FunctionReceiveAdapter) HandleReceive(m *channel2.Message, ch channel2.Channel)
type Identifiable ¶
type Identifiable interface {
Id() uint32
}
type ListenOptions ¶
type ListenOptions struct { Cost uint16 Precedence Precedence ConnectTimeout time.Duration MaxConnections int Identity string IdentitySecret string BindUsingEdgeIdentity bool ManualStart bool }
func (*ListenOptions) GetConnectTimeout ¶
func (options *ListenOptions) GetConnectTimeout() time.Duration
func (*ListenOptions) String ¶
func (options *ListenOptions) String() string
type MsgChannel ¶
func NewEdgeMsgChannel ¶
func NewEdgeMsgChannel(ch channel2.Channel, connId uint32) *MsgChannel
func (*MsgChannel) Id ¶
func (ec *MsgChannel) Id() uint32
func (*MsgChannel) NextMsgId ¶ added in v0.15.0
func (ec *MsgChannel) NextMsgId() uint32
func (*MsgChannel) SetWriteDeadline ¶
func (ec *MsgChannel) SetWriteDeadline(t time.Time) error
func (*MsgChannel) WriteTraced ¶
type MsgMux ¶
type MsgMux interface { channel2.ReceiveHandler channel2.CloseHandler AddMsgSink(sink MsgSink) error RemoveMsgSink(sink MsgSink) RemoveMsgSinkById(sinkId uint32) Close() GetNextId() uint32 }
func NewCowMapMsgMux ¶ added in v0.15.0
func NewCowMapMsgMux() MsgMux
type PostureQueries ¶ added in v0.14.5
type PostureQueries struct { IsPassing bool `json:"isPassing"` PostureQueries []PostureQuery }
type PostureQuery ¶ added in v0.14.5
type PostureQuery struct { Id string `json:"id"` IsPassing bool `json:"isPassing"` QueryType string `json:"queryType"` Process *PostureQueryProcess `json:"process"` }
type PostureQueryProcess ¶ added in v0.14.5
type Precedence ¶
type Precedence byte
type RouterClient ¶ added in v0.15.5
type RouterClient interface { Connect(service *Service, session *Session, options *DialOptions) (Conn, error) Listen(service *Service, session *Session, options *ListenOptions) (Listener, error) }
type RouterConn ¶
type Service ¶
type Service struct { Id string `json:"id"` Name string `json:"name"` Permissions []string `json:"permissions"` Encryption bool `json:"encryptionRequired"` PostureQueries []PostureQueries `json:"postureQueries"` Configs map[string]map[string]interface{} `json:"config"` Tags map[string]string `json:"tags"` }
type ServiceConn ¶ added in v0.12.0
type ServiceUpdates ¶ added in v0.15.13
type Session ¶
type Session struct { Id string `json:"id"` Service ApiIdentity `json:"service"` Token string `json:"token"` Type SessionType `json:"type"` EdgeRouters []EdgeRouter `json:"edgeRouters"` }
type SessionListener ¶ added in v0.13.2
type SessionType ¶ added in v0.13.0
type SessionType string
const ( SessionDial SessionType = "Dial" SessionBind SessionType = "Bind" )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.