service

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Net_Tcp  = "tcp"
	Net_Addr = "%s:%d"
)

Variables

This section is empty.

Functions

func Get

func Get[T object.ObjectInterface](ctx context.Context, namespace, name string) T

func Init

func Init(logConf zap.Config)

func Listen

func Listen(host string, prot int) error

func OpenTracing

func OpenTracing(open string)

func Register

func Register(sv ServiceInterface)

func RegisterToCenter

func RegisterToCenter(conf etcd.Config, ttl int64, listen *krpc.Local) error

func Stop

func Stop()

Types

type Base

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

func NewBase

func NewBase(desc *grpc.ServiceDesc, objs ...*ObjDesc) *Base

func (*Base) Deps

func (b *Base) Deps() map[string][]*ObjDesc

func (*Base) Desc

func (b *Base) Desc() *grpc.ServiceDesc

type Context

type Context struct {
	context.Context
	// contains filtered or unexported fields
}

func NewContext

func NewContext() *Context

func (*Context) FullName

func (c *Context) FullName() string

func (*Context) Get

func (c *Context) Get(namespace, name string) object.ObjectInterface

func (*Context) Init

func (c *Context) Init(ctx context.Context)

func (*Context) Reset

func (c *Context) Reset()

type ObjDesc

type ObjDesc struct {
	Namespace string
	Name      string
	Method    string
}

func NewObjDesc

func NewObjDesc(namespace, name, method string) *ObjDesc

type ServiceInterface

type ServiceInterface interface {
	Desc() *grpc.ServiceDesc
	Deps() map[string][]*ObjDesc
}

Jump to

Keyboard shortcuts

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