gate_client

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Request ...
	Request = "request"
	// Response ...
	Response = "response"
	// StatusSuccess ...
	StatusSuccess = "success"
	// StatusError ...
	StatusError = "error"
)
View Source
const (
	// GateStatusWait ...
	GateStatusWait = "wait"
	// GateStatusConnected ...
	GateStatusConnected = "connected"
	// GateStatusNotConnected ...
	GateStatusNotConnected = "not connected"
	// GateStatusQuit ...
	GateStatusQuit = "quit"
)
View Source
const (
	// MobileGateProxy ...
	MobileGateProxy = string("mobile_gate_proxy")
	// AlexaGateProxy ...
	AlexaGateProxy = string("alexa_gate_proxy")
)
View Source
const (
	// ClientTypeServer ...
	ClientTypeServer = "server"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GateClient

type GateClient struct {
	sync.Mutex
	// contains filtered or unexported fields
}

GateClient ...

func NewGateClient

func NewGateClient(adaptors *adaptors.Adaptors,
	graceful *graceful_service.GracefulService,
	metric *metrics.MetricManager) (gate *GateClient)

NewGateClient ...

func (*GateClient) AddMobile

func (g *GateClient) AddMobile(ctx context.Context) (list *MobileList, err error)

AddMobile ...

func (*GateClient) Broadcast added in v0.0.15

func (g *GateClient) Broadcast(message []byte)

Broadcast ...

func (*GateClient) Close

func (g *GateClient) Close()

Close ...

func (*GateClient) DeleteMobile

func (g *GateClient) DeleteMobile(token string, ctx context.Context) (list *MobileList, err error)

DeleteMobile ...

func (*GateClient) GetMobileList

func (g *GateClient) GetMobileList(ctx context.Context) (list *MobileList, err error)

GetMobileList ...

func (*GateClient) GetSettings

func (g *GateClient) GetSettings() (Settings, error)

GetSettings ...

func (*GateClient) RegisterServer added in v0.0.13

func (g *GateClient) RegisterServer()

RegisterServer ...

func (*GateClient) RequestFromProxy added in v0.3.0

func (g *GateClient) RequestFromProxy(message stream.Message, engine *gin.Engine)

RequestFromProxy ...

func (*GateClient) Restart added in v0.0.13

func (g *GateClient) Restart()

Restart ...

func (*GateClient) Send

func (g *GateClient) Send(command string, payload map[string]interface{}, ctx context.Context, f func(msg stream.Message)) (err error)

Send ...

func (*GateClient) SetAlexaApiEngine added in v0.3.0

func (g *GateClient) SetAlexaApiEngine(engine *gin.Engine)

SetAlexaApiEngine ...

func (*GateClient) SetMobileApiEngine added in v0.3.0

func (g *GateClient) SetMobileApiEngine(engine *gin.Engine)

SetMobileApiEngine ...

func (*GateClient) Shutdown

func (g *GateClient) Shutdown()

Shutdown ...

func (*GateClient) Status

func (g *GateClient) Status() string

Status ...

func (*GateClient) Subscribe

func (g *GateClient) Subscribe(command string, f func(client stream.IStreamClient, msg stream.Message))

Subscribe ...

func (*GateClient) UnSubscribe

func (g *GateClient) UnSubscribe(command string)

UnSubscribe ...

func (*GateClient) UpdateSettings

func (g *GateClient) UpdateSettings(settings Settings) (err error)

UpdateSettings ...

type IWsCallback

type IWsCallback interface {
	// contains filtered or unexported methods
}

IWsCallback ...

type MobileList

type MobileList struct {
	Total     int64    `json:"total"`
	TokenList []string `json:"token_list"`
}

MobileList ...

type Settings

type Settings struct {
	GateServerToken string `json:"gate_server_token"`
	Address         string `json:"address"`
	Enabled         bool   `json:"enabled"`
}

Settings ...

func (Settings) Equal added in v0.0.25

func (s Settings) Equal(v Settings) bool

Equal ...

func (Settings) Valid

func (s Settings) Valid() bool

Valid ...

type StreamRequestModel added in v0.0.11

type StreamRequestModel struct {
	URI    string      `json:"uri"`
	Method string      `json:"method"`
	Body   []byte      `json:"body"`
	Header http.Header `json:"header"`
}

StreamRequestModel ...

type StreamResponseModel added in v0.0.11

type StreamResponseModel struct {
	Code   int         `json:"code"`
	Body   []byte      `json:"body"`
	Header http.Header `json:"header"`
}

StreamResponseModel ...

type WsClient

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

WsClient ...

func NewWsClient

func NewWsClient(cb IWsCallback, metric *metrics.MetricManager) *WsClient

NewWsClient ...

func (*WsClient) Close

func (client *WsClient) Close()

Close ...

func (*WsClient) Notify added in v0.1.1

func (client *WsClient) Notify(t, b string)

Notify ...

func (*WsClient) Status added in v0.0.25

func (client *WsClient) Status() string

Status ...

func (*WsClient) UpdateSettings added in v0.0.23

func (client *WsClient) UpdateSettings(settings Settings)

UpdateSettings ...

func (*WsClient) Write added in v0.1.1

func (client *WsClient) Write(payload []byte) (err error)

Write ...

Jump to

Keyboard shortcuts

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