Documentation ¶
Index ¶
- Variables
- func ContainsSocketActionType(types []string, actionType ...SocketActionType) bool
- func ContainsSuccessTerm(terms []string, term SuccessTerm) bool
- func ContainsTermError(conditions []string, termError ErrorTypeForTerm) bool
- func NewSock(s *Socket, outputEnabled bool) *sock
- func SocketConnect(ctx context.Context, ctr *app.Container, conf SocketConnectConfig, ...) error
- func SocketConnectAndSubscribe(ctx context.Context, ctr *app.Container, conf SocketConnectAndSubscribeConfig, ...) error
- func SocketSubscribe(ctx context.Context, ctr *app.Container, conf SocketSubscribeConfig, ...) error
- type BatchTestOutput
- type DataTypeChan
- type ErrorTypeForTerm
- type SelfEventFilter
- type Socket
- type SocketActionType
- type SocketConnectAndSubscribeConfig
- type SocketConnectConfig
- type SocketSubscribeActionConfig
- type SocketSubscribeActionDataConfig
- type SocketSubscribeConfig
- type SocketSubscribeSelfEventFilterConfig
- type SocketSubscribeSubscribeConfig
- type SocketSubscribeTermConditionConfig
- type SocketSubscribeTermConditionEventConfig
- type SuccessTerm
Constants ¶
This section is empty.
Variables ¶
View Source
var GlobalSock = &globalSock{ mu: &sync.Mutex{}, sockMap: make(map[string]*sock), }
Functions ¶
func ContainsSocketActionType ¶
func ContainsSocketActionType(types []string, actionType ...SocketActionType) bool
func ContainsSuccessTerm ¶
func ContainsSuccessTerm(terms []string, term SuccessTerm) bool
func ContainsTermError ¶
func ContainsTermError(conditions []string, termError ErrorTypeForTerm) bool
func SocketConnect ¶
Types ¶
type BatchTestOutput ¶
type BatchTestOutput struct {
Enabled bool `yaml:"enabled"`
}
type DataTypeChan ¶
type DataTypeChan int
const ( DataTypeChanSuccessEvent DataTypeChan DataTypeChanFailEvent DataChanError )
type ErrorTypeForTerm ¶
type ErrorTypeForTerm string
const ( ErrorTypeForTermParseError ErrorTypeForTerm = "parse_error" ErrorTypeForTermUnmarshalError ErrorTypeForTerm = "unmarshal_error" ErrorTypeForTermReadError ErrorTypeForTerm = "read_error" ErrorTypeForTermSendError ErrorTypeForTerm = "send_error" )
type SelfEventFilter ¶
type SelfEventFilter struct {
JMESPath *jmespath.JMESPath
}
type Socket ¶
type Socket struct {
// contains filtered or unexported fields
}
func NewSocketWithSubscribeHandler ¶
func NewSocketWithSubscribeHandler( ctx context.Context, ctr *app.Container, msgHandler ws.EventResponseMessageHandleFunc, subscribeHandler ws.SubscribeResponseMessageHandleFunc, ) (*Socket, error)
type SocketActionType ¶
type SocketActionType string
const ( SocketActionTypeStore SocketActionType = "store" SocketActionTypeOutput SocketActionType = "output" SocketActionTypeUnsubscribe SocketActionType = "unsubscribe" )
type SocketConnectAndSubscribeConfig ¶
type SocketConnectAndSubscribeConfig struct { Type string `yaml:"type"` Output BatchTestOutput `yaml:"output"` Subscribes []SocketSubscribeSubscribeConfig `yaml:"subscribes"` Actions []SocketSubscribeActionConfig `yaml:"actions"` SuccessTerm []string `yaml:"successTerm"` Term SocketSubscribeTermConditionConfig `yaml:"termCondition"` }
type SocketConnectConfig ¶
type SocketConnectConfig struct { Type string `yaml:"type"` Output BatchTestOutput `yaml:"output"` ID string `yaml:"id"` SuccessTerm []string `yaml:"successTerm"` Term SocketSubscribeTermConditionConfig `yaml:"termCondition"` }
type SocketSubscribeActionConfig ¶
type SocketSubscribeActionConfig struct { ID string `yaml:"id"` Types []string `yaml:"types"` EventTypes []string `yaml:"eventTypes"` Data []SocketSubscribeActionDataConfig `yaml:"data"` }
type SocketSubscribeConfig ¶
type SocketSubscribeConfig struct { Type string `yaml:"type"` Output BatchTestOutput `yaml:"output"` ID string `yaml:"id"` ConnectID string `yaml:"connectId"` SelfEventFilter SocketSubscribeSelfEventFilterConfig `yaml:"selfEventFilter"` Subscribe SocketSubscribeSubscribeConfig `yaml:"subscribe"` SuccessUnsubscribeActionIDs []string `yaml:"successUnsubscribeActionIds"` Actions []SocketSubscribeActionConfig `yaml:"actions"` }
type SocketSubscribeSelfEventFilterConfig ¶
type SocketSubscribeSelfEventFilterConfig struct {
JMESPath string `yaml:"jmesPath"`
}
type SocketSubscribeTermConditionConfig ¶
type SocketSubscribeTermConditionConfig struct { Time *string `yaml:"time"` Error []string `yaml:"error"` Event []SocketSubscribeTermConditionEventConfig `yaml:"event"` }
type SuccessTerm ¶
type SuccessTerm string
const ( SuccessTermClose SuccessTerm = "close" SuccessTermTime SuccessTerm = "time" SuccessTermError SuccessTerm = "error" SuccessTermEvent SuccessTerm = "event" SuccessTermData SuccessTerm = "data" )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.