Documentation ¶
Index ¶
- Constants
- Variables
- type DataBase
- func (db *DataBase) AddWatcher(handle WatcherFunc)
- func (db *DataBase) GetMethodType(uuid uint64, methodId uint32) *MethodDescriptor
- func (db *DataBase) GetServiceType(uuid uint64) *ServiceDescriptor
- func (db *DataBase) Init(opts ...Option) error
- func (db *DataBase) RangeServices(iterator IteratorFunc) error
- func (db *DataBase) ShutDown()
- func (db *DataBase) Start() (err error)
- type FileDescriptor
- type IteratorFunc
- type MethodDescriptor
- type Option
- type Options
- type ServiceDescriptor
- type WatcherFunc
Constants ¶
View Source
const ( ServiceAdded = iota + 1 ServiceModify ServiceRemove )
Variables ¶
View Source
var ( InvalidIdlPath = errors.New("invalid idl file path") InvalidIteratorFunc = errors.New("no effective iterator function ") )
Functions ¶
This section is empty.
Types ¶
type DataBase ¶
type DataBase struct {
// contains filtered or unexported fields
}
func MakeDataBase ¶
func MakeDataBase() *DataBase
func (*DataBase) AddWatcher ¶
func (db *DataBase) AddWatcher(handle WatcherFunc)
func (*DataBase) GetMethodType ¶ added in v0.4.19
func (db *DataBase) GetMethodType(uuid uint64, methodId uint32) *MethodDescriptor
func (*DataBase) GetServiceType ¶ added in v0.4.19
func (db *DataBase) GetServiceType(uuid uint64) *ServiceDescriptor
func (*DataBase) RangeServices ¶
func (db *DataBase) RangeServices(iterator IteratorFunc) error
type FileDescriptor ¶
type FileDescriptor struct { BaseName string `json:"-"` //配置文件名 IdlName string `json:"idlname"` //idl 文件名 Services []*ServiceDescriptor `json:"services"` //idl 文件中包含的服务 }
FileDescriptor 文件描述结构体
type IteratorFunc ¶
type IteratorFunc func(uint64, *ServiceDescriptor, error) error
IteratorFunc 迭代方法,参数为服务数字uid ,服务描述,是否有错误; 如果希望终端迭代,返回非空错误
type MethodDescriptor ¶
type MethodDescriptor struct { Index uint32 `json:"index"` //方法序号 Name string `json:"name"` //方法名 Oneway bool `json:"oneway"` //是否oneway Public bool `json:"public"` // 是否public 方法 与 protected 互斥 Protected bool `json:"protected"` // 是否protect 方法, 与 public 互斥 TimeOut uint32 `json:"timeout"` // 超时时间 }
MethodDescriptor 方法描述结构
type Option ¶
type Option func(option *Options)
func WithConfigPath ¶
func WithConfigSuffix ¶
func WithLogger ¶
type Options ¶
type Options struct { DescriptionPath string `json:"description_path"` //配置路径 Suffix string `json:"suffix"` //配置文件后缀 // contains filtered or unexported fields }
Options 描述符
type ServiceDescriptor ¶
type ServiceDescriptor struct { Uuid string `json:"uuid"` // 服务UUID Name string `json:"name"` // 服务名 Methods []*MethodDescriptor `json:"methods"` // 服务方法名 }
ServiceDescriptor 服务描述结构
Click to show internal directories.
Click to hide internal directories.