ws

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	ID          primitive.ObjectID `bson:"_id, omitempty"json:"id"`       // id
	Name        string             `bson:"name"json:"name"form:"name"`    // name of the agentprobe
	Site        primitive.ObjectID `bson:"site"json:"site"`               // _id of mongo object
	Pin         string             `bson:"pin"json:"pin"`                 // used for registration & authentication
	Initialized bool               `bson:"initialized"json:"initialized"` // will this be used or will we use the sessions/jwt tokens?
	Location    string             `bson:"location"json:"location"`       // logical/physical location
	CreatedAt   time.Time          `bson:"createdAt"json:"createdAt"`
	UpdatedAt   time.Time          `bson:"updatedAt"json:"updatedAt"`
}

type DataToBeSent

type DataToBeSent struct {
	Data []byte
}

type EventTypeWS

type EventTypeWS string

type RestClient

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

RestClient object

func NewClient

func NewClient(config RestClientConfig) RestClient

NewClient constructor

func (RestClient) Request

func (c RestClient) Request(method, endpoint string, data, response interface{}) error

Request executes any HubSpot API method using the current client configuration

type RestClientConfig

type RestClientConfig struct {
	APIHost     string
	APIUsername string
	APIPassword string
	HTTPTimeout time.Duration
	DialTimeout time.Duration
	TLSTimeout  time.Duration
}

RestClientConfig object used for client creation

func NewClientConfig

func NewClientConfig() RestClientConfig

NewClientConfig constructs a RestClientConfig object with the environment variables set as default

type WebSocketEvent

type WebSocketEvent struct {
	Namespace string      `json:"namespace"`
	EventType EventTypeWS `json:"event_name"`
	Func      func(nsConn *websocket.NSConn, msg websocket.Message) error
}

type WebSocketHandler

type WebSocketHandler struct {
	Host   string
	Pin    string
	ID     string
	HostWS string
	Events []*WebSocketEvent `json:"events"`

	Namespaces       *websocket.Namespaces
	RestClientConfig RestClientConfig
	ProbeGetCh       chan []probes.Probe
	// contains filtered or unexported fields
}

func (*WebSocketHandler) GetConnection

func (wsH *WebSocketHandler) GetConnection() *websocket.NSConn

func (*WebSocketHandler) InitWS

func (wsH *WebSocketHandler) InitWS() error

Jump to

Keyboard shortcuts

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