backend

package
v0.0.0-...-b4d0808 Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WSSRequestMethodError = 1
	WSSUserAuthError      = 101
	WSSParamError         = 102
	WSSNotLogin           = 103
	WSSRequestOK          = 200
	WSSSeverHandleError   = 501
	WSSSeverError         = 500
)

Error String

View Source
const (
	WSShowAllSream = iota
	WSGetLivePlayerCount
	WSEventBlackList
	WSSetBlackList
	WSEnableWhiteList
	WSSetWhiteList
	WSSetUpStreamApp
	WSPullRtmpStream
	WSAddSink
	WSDelSink
	WSAddSource
	WSDelSource
	WSGetSource
)

action enum

Variables

View Source
var LoginHandler *adminLoginHandler

LoginHandler for user

Functions

func BadRequest

func BadRequest(code int, msg string) ([]byte, error)

BadRequest func

func SendResponse

func SendResponse(responseData []byte, err error, w http.ResponseWriter)

SendResponse To Usr

Types

type Action

type Action struct {
	ActionCode  int    `json:"action_code"`
	ActionToken string `json:"action_token"`
}

Action struct

type ActionResponseData

type ActionResponseData struct {
	Code  int      `json:"code"`
	Datas []object `json:"datas"`
	Data  object   `json:"data"`
	Msg   string   `json:"msg,omitempty"`
}

ActionResponseData struct

type BackendConfig

type BackendConfig struct {
	Port     int    `json:"Port"`
	RootName string `json:"Usr"`
	RootPwd  string `json:"Pwd"`
}

BackendConfig for web

type BackendService

type BackendService struct {
}

BackendService for web

func (*BackendService) GetType

func (backend *BackendService) GetType() string

GetType of backend Service

func (*BackendService) HandleTask

func (backend *BackendService) HandleTask(task wssapi.Task) (err error)

HandleTask of Service

func (*BackendService) Init

func (backend *BackendService) Init(msg *wssapi.Msg) (err error)

Init BackendService

func (*BackendService) ProcessMessage

func (backend *BackendService) ProcessMessage(msg *wssapi.Msg) (err error)

ProcessMessage of Service

func (*BackendService) SetParent

func (backend *BackendService) SetParent(parent wssapi.MsgHandler)

SetParent handler for Service

func (*BackendService) Start

func (backend *BackendService) Start(msg *wssapi.Msg) (err error)

Start Service in Goroutine

func (*BackendService) Stop

func (backend *BackendService) Stop(msg *wssapi.Msg) (err error)

Stop Service

type BadRequestData

type BadRequestData struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

BadRequestData struct

type Data

type Data struct {
	UserData Usr    `json:"usr_data"`
	Action   Action `json:"action"`
}

Data struct

type LoginResponseData

type LoginResponseData struct {
	Code int    `json:"code"`
	Data Data   `json:"data,omitempty"`
	Msg  string `json:"msg"`
}

LoginResponseData struct

type Usr

type Usr struct {
	Usrname string `json:"usrname"`
	Token   string `json:"token"`
}

Usr struct

Jump to

Keyboard shortcuts

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