scclient

package
v0.0.0-...-f177657 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ConnectionOptions gowebsocket.ConnectionOptions
	RequestHeader     http.Header

	Listener
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, url string, logger logr.Logger, defTimeout time.Duration) Client

func (*Client) Connect

func (client *Client) Connect() context.Context

func (*Client) Disconnect

func (client *Client) Disconnect() error

func (*Client) Emit

func (client *Client) Emit(eventName string, data interface{}) error

func (*Client) EmitAck

func (client *Client) EmitAck(eventName string, data interface{}, timeout time.Duration, ack EmitAckFunc) error

func (*Client) GetAuthToken

func (client *Client) GetAuthToken() *string

func (*Client) GetLogger

func (client *Client) GetLogger() logr.Logger

func (*Client) IsConnected

func (client *Client) IsConnected() bool

func (*Client) On

func (client *Client) On(eventName string, ack func(eventName string, data interface{}))

func (*Client) OnAck

func (client *Client) OnAck(eventName string, ack func(eventName string, data interface{}, ack func(error interface{}, data interface{}) error))

func (*Client) OnChannel

func (client *Client) OnChannel(eventName string, ack func(eventName string, data interface{}))

func (*Client) Publish

func (client *Client) Publish(channelName string, data interface{}) error

func (*Client) PublishAck

func (client *Client) PublishAck(channelName string, data interface{}, timeout time.Duration, ack func(eventName string, error interface{}, data interface{})) error

func (*Client) SetAuthToken

func (client *Client) SetAuthToken(token string)

func (*Client) SetAuthenticationListener

func (client *Client) SetAuthenticationListener(onSetAuthentication func(client Client, token string), onAuthentication func(client Client, isAuthenticated bool))

func (*Client) SetBasicListener

func (client *Client) SetBasicListener(onConnect func(client Client), onConnectError func(client Client, err error), onDisconnect func(client Client, err error))

func (*Client) Subscribe

func (client *Client) Subscribe(channelName string) error

func (*Client) SubscribeAck

func (client *Client) SubscribeAck(channelName string, timeout time.Duration, ack func(eventName string, error interface{}, data interface{})) error

func (*Client) Unsubscribe

func (client *Client) Unsubscribe(channelName string) error

func (*Client) UnsubscribeAck

func (client *Client) UnsubscribeAck(channelName string, timeout time.Duration, ack func(eventName string, error interface{}, data interface{})) error

type EmitAckFunc

type EmitAckFunc func(eventName string, error interface{}, data interface{})

type Empty

type Empty struct{}

type Listener

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

func Init

func Init(ctx context.Context, logger logr.Logger) Listener

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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