skymeta

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 18 Imported by: 0

README

skymeta

介绍

服务端框架开发尝试

软件架构

软件架构说明

安装教程
  1. xxxx
  2. xxxx
  3. xxxx
使用说明
  1. xxxx
  2. xxxx
  3. xxxx
参与贡献
  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NodeID uint16
)

Functions

func AddTagFilter

func AddTagFilter(tag string)

AddTagFilter Add a tag filter item

func Call

func Call(source, destination uint64, msgName string, msg []byte) (respSession, respSource uint64, respName string, respData []byte, err error)

func Debugf

func Debugf(tag, format string, args ...any)

Debug log

func DelTagFilter

func DelTagFilter(tag string)

DelTagFilter Delete a tag filter item

func Errorf

func Errorf(tag, format string, args ...any)

Error log

func Fatalf

func Fatalf(tag, format string, args ...any)

Fatal log

func Infof

func Infof(tag, format string, args ...any)

Info log

func Init

func Init(dotenv string)

func KillService

func KillService(serviceID uint64)

KillService Shutdwon a local service, and notify to cluster.

func ListService

func ListService() (res map[string][]uint64)

ListService Divided all service to a map according to service name and return the map.

func LogServiceCallback

func LogServiceCallback(callback port.LogServiceCallBack)

LogServiceCallback Intercepts log data to callback function.

func NewCommunicator added in v0.1.0

func NewCommunicator[T any](ctx context.Context, host network.ICommHost[T]) *network.Communicator[T]

func NewService

func NewService(instance IService) error

NewService Launch a local service, and notify to cluster.

func Panicf

func Panicf(tag, format string, args ...any)

Panic log

func QueryService

func QueryService(srvName string) (list []uint64)

QueryService Match service name of everyone service with 'srvName', put the service id of matched service to a slice, and return the slice.

func ResetFilter

func ResetFilter()

ResetFilter Clear all tag filter item

func Response

func Response(source, destination, sequence uint64, msgName string, msg []byte)

func Run

func Run()

func Send

func Send(source, destination uint64, msgName string, msg []byte)

func SetLogLevel

func SetLogLevel(level string) error

SetLogLevel Set log level

func Shutdown

func Shutdown()

func Tracef

func Tracef(tag, format string, args ...any)

Trace log

func Warnf

func Warnf(tag, format string, args ...any)

Warning log

Types

type IService

type IService interface {
	Init(ctx context.Context, serviceID uint64) error
	Shutdown()
	GetServiceID() uint64
	GetServiceName() string
	OnMessage(session, source uint64, msgName string, msgBody []byte)
}

Directories

Path Synopsis
logutil包提供一个日志对象 日志对象提供一下功能: 1、提供 Panic Fatal Error Warn Info Debug Trace 七个日志级别,以及动态设置 2、支持指定日志路径与日志文件名 3、支持动态设置tag过滤
logutil包提供一个日志对象 日志对象提供一下功能: 1、提供 Panic Fatal Error Warn Info Debug Trace 七个日志级别,以及动态设置 2、支持指定日志路径与日志文件名 3、支持动态设置tag过滤

Jump to

Keyboard shortcuts

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