common

package
v0.0.0-...-799f385 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int

Action type for enum

const (
	ADD Action = iota
	DEL
)

Action values

type NetIdType

type NetIdType uint32

type RouteStr

type RouteStr struct {
	Server  string
	Service string
	Method  string
	// contains filtered or unexported fields
}

简单route str处理

func NewRouteStr

func NewRouteStr(in string) *RouteStr

func (*RouteStr) GetLongStr

func (self *RouteStr) GetLongStr() string

获取长route

func (*RouteStr) GetShortStr

func (self *RouteStr) GetShortStr() string

func (*RouteStr) Init

func (self *RouteStr) Init(in string)

type Server

type Server struct {
	// 如 room-1
	ID string `json:"id"`
	// 如 room
	Type string `json:"type"`
	// reserved
	Metadata map[string]string `json:"metadata"`
	// 可连接地址
	Address string `json:"address"`
	//
	Frontend        bool   `json:"frontend"`
	ClientAddress   string `json:"clientaddress"`
	WSClientAddress string `json:"wsclientaddress"`
}

Server struct

func NewServer

func NewServer(id, serverType, address string, metadata ...map[string]string) *Server

NewServer ctor

func (*Server) AsJSONString

func (s *Server) AsJSONString() string

AsJSONString returns the server as a json string

Jump to

Keyboard shortcuts

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