Documentation ¶
Index ¶
- Constants
- Variables
- type GateClient
- func (g *GateClient) AddMobile(ctx context.Context) (list *MobileList, err error)
- func (g *GateClient) Broadcast(message []byte)
- func (g *GateClient) BroadcastAccessToken()
- func (g *GateClient) Close()
- func (g *GateClient) Connect()
- func (g *GateClient) DeleteMobile(token string, ctx context.Context) (list *MobileList, err error)
- func (g *GateClient) GetMobileList(ctx context.Context) (list *MobileList, err error)
- func (g *GateClient) GetSettings() (*Settings, error)
- func (g *GateClient) LoadSettings() (err error)
- func (g *GateClient) RegisterServer()
- func (g *GateClient) RequestFromMobileProxy(message Message)
- func (g *GateClient) Restart()
- func (g *GateClient) SaveSettings() (err error)
- func (g *GateClient) Send(command string, payload map[string]interface{}, ctx context.Context, ...) (err error)
- func (g *GateClient) SetEngine(engine *gin.Engine)
- func (g *GateClient) Shutdown()
- func (g *GateClient) Status() string
- func (g *GateClient) Subscribe(id uuid.UUID, f func(msg Message))
- func (g *GateClient) UnSubscribe(id uuid.UUID)
- func (g *GateClient) UpdateSettings(settings *Settings) (err error)
- type IWsCallback
- type Message
- type MobileList
- type Settings
- type StreamRequestModel
- type StreamResponseModel
- type WsClient
Constants ¶
View Source
const ( Request = "request" Response = "response" StatusSuccess = "success" StatusError = "error" )
View Source
const ( GateStatusWait = "wait" GateStatusDisabled = "disabled" GateStatusConnected = "connected" )
View Source
const (
ClientTypeServer = "server"
)
Variables ¶
View Source
var (
ErrGateNotConnected = fmt.Errorf("gate not connected")
)
Functions ¶
This section is empty.
Types ¶
type GateClient ¶
func NewGateClient ¶
func NewGateClient(adaptors *adaptors.Adaptors, graceful *graceful_service.GracefulService, stream *stream.StreamService) (gate *GateClient)
func (*GateClient) AddMobile ¶
func (g *GateClient) AddMobile(ctx context.Context) (list *MobileList, err error)
func (*GateClient) Broadcast ¶ added in v0.0.15
func (g *GateClient) Broadcast(message []byte)
func (*GateClient) BroadcastAccessToken ¶ added in v0.0.13
func (g *GateClient) BroadcastAccessToken()
func (*GateClient) Close ¶
func (g *GateClient) Close()
func (*GateClient) Connect ¶
func (g *GateClient) Connect()
func (*GateClient) DeleteMobile ¶
func (g *GateClient) DeleteMobile(token string, ctx context.Context) (list *MobileList, err error)
func (*GateClient) GetMobileList ¶
func (g *GateClient) GetMobileList(ctx context.Context) (list *MobileList, err error)
func (*GateClient) GetSettings ¶
func (g *GateClient) GetSettings() (*Settings, error)
func (*GateClient) LoadSettings ¶
func (g *GateClient) LoadSettings() (err error)
func (*GateClient) RegisterServer ¶ added in v0.0.13
func (g *GateClient) RegisterServer()
func (*GateClient) RequestFromMobileProxy ¶ added in v0.0.11
func (g *GateClient) RequestFromMobileProxy(message Message)
func (*GateClient) Restart ¶ added in v0.0.13
func (g *GateClient) Restart()
func (*GateClient) SaveSettings ¶
func (g *GateClient) SaveSettings() (err error)
func (*GateClient) SetEngine ¶ added in v0.0.11
func (g *GateClient) SetEngine(engine *gin.Engine)
func (*GateClient) Shutdown ¶
func (g *GateClient) Shutdown()
func (*GateClient) Status ¶
func (g *GateClient) Status() string
func (*GateClient) UnSubscribe ¶
func (g *GateClient) UnSubscribe(id uuid.UUID)
func (*GateClient) UpdateSettings ¶
func (g *GateClient) UpdateSettings(settings *Settings) (err error)
type IWsCallback ¶
type IWsCallback interface {
// contains filtered or unexported methods
}
type Message ¶
type Message struct { Id uuid.UUID `json:"id"` Command string `json:"command"` Payload map[string]interface{} `json:"payload"` Forward string `json:"forward"` Status string `json:"status"` }
func NewMessage ¶
type MobileList ¶
type Settings ¶
type StreamRequestModel ¶ added in v0.0.11
type StreamResponseModel ¶ added in v0.0.11
type WsClient ¶
func NewWsClient ¶
func NewWsClient(adaptors *adaptors.Adaptors, cb IWsCallback) *WsClient
Click to show internal directories.
Click to hide internal directories.