Documentation ¶
Overview ¶
Package eosc SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- Variables
- func CreateFile(name string) (*os.File, error)
- func Decompress(filePath string, dest string) error
- func FileSha1(file *os.File, size int64) (string, error)
- func GetRealIP(r *http.Request) string
- func Now() string
- func ReadStringFromEntry(entry IEntry, key string) string
- func SHA1(data []byte) string
- func SplitWorkerId(id string) (profession string, name string, success bool)
- func ToWorkerId(name, profession string) (string, bool)
- func Version() string
- type DriverConfig
- func (*DriverConfig) Descriptor() ([]byte, []int)deprecated
- func (x *DriverConfig) GetDesc() string
- func (x *DriverConfig) GetId() string
- func (x *DriverConfig) GetLabel() string
- func (x *DriverConfig) GetName() string
- func (x *DriverConfig) GetParams() map[string]string
- func (*DriverConfig) ProtoMessage()
- func (x *DriverConfig) ProtoReflect() protoreflect.Message
- func (x *DriverConfig) Reset()
- func (x *DriverConfig) String() string
- type EoFiles
- type ExtenderBuilder
- type ExtenderRegister
- type ExtendersSettings
- func (*ExtendersSettings) Descriptor() ([]byte, []int)deprecated
- func (x *ExtendersSettings) GetExtenders() map[string]string
- func (*ExtendersSettings) ProtoMessage()
- func (x *ExtendersSettings) ProtoReflect() protoreflect.Message
- func (x *ExtendersSettings) Reset()
- func (x *ExtendersSettings) String() string
- type FormatterConfig
- type GzipFile
- type IDataMarshaller
- type IEntry
- type IExtenderConfigChecker
- type IExtenderDisable
- type IExtenderDriver
- type IExtenderDriverFactory
- type IExtenderDriverManager
- type IExtenderDriverRegister
- type IExtenderDrivers
- type IFormatter
- type IFormatterFactory
- type IMetricEntry
- type IProfession
- type IProfessions
- type IRegister
- type IRequires
- type ISetting
- type ISettings
- type IVariable
- type IWorker
- type IWorkerDestroy
- type IWorkers
- type Item
- type ProcessStatus
- func (*ProcessStatus) Descriptor() ([]byte, []int)deprecated
- func (x *ProcessStatus) GetData() []byte
- func (x *ProcessStatus) GetMsg() string
- func (x *ProcessStatus) GetStatus() int32
- func (*ProcessStatus) ProtoMessage()
- func (x *ProcessStatus) ProtoReflect() protoreflect.Message
- func (x *ProcessStatus) Reset()
- func (x *ProcessStatus) String() string
- type ProfessionConfig
- func (*ProfessionConfig) Descriptor() ([]byte, []int)deprecated
- func (x *ProfessionConfig) GetAppendLabels() []string
- func (x *ProfessionConfig) GetDependencies() []string
- func (x *ProfessionConfig) GetDesc() string
- func (x *ProfessionConfig) GetDrivers() []*DriverConfig
- func (x *ProfessionConfig) GetLabel() string
- func (x *ProfessionConfig) GetMod() ProfessionConfig_ProfessionMod
- func (x *ProfessionConfig) GetName() string
- func (*ProfessionConfig) ProtoMessage()
- func (x *ProfessionConfig) ProtoReflect() protoreflect.Message
- func (x *ProfessionConfig) Reset()
- func (x *ProfessionConfig) String() string
- type ProfessionConfig_ProfessionMod
- func (ProfessionConfig_ProfessionMod) Descriptor() protoreflect.EnumDescriptor
- func (x ProfessionConfig_ProfessionMod) Enum() *ProfessionConfig_ProfessionMod
- func (ProfessionConfig_ProfessionMod) EnumDescriptor() ([]byte, []int)deprecated
- func (x ProfessionConfig_ProfessionMod) Number() protoreflect.EnumNumber
- func (x ProfessionConfig_ProfessionMod) String() string
- func (ProfessionConfig_ProfessionMod) Type() protoreflect.EnumType
- type ProfessionConfigs
- func (*ProfessionConfigs) Descriptor() ([]byte, []int)deprecated
- func (x *ProfessionConfigs) GetData() []*ProfessionConfig
- func (*ProfessionConfigs) ProtoMessage()
- func (x *ProfessionConfigs) ProtoReflect() protoreflect.Message
- func (x *ProfessionConfigs) Reset()
- func (x *ProfessionConfigs) String() string
- type Register
- type RequireId
- type SettingMode
- type TWorker
- type Untyped
- type WorkerConfig
- func (*WorkerConfig) Descriptor() ([]byte, []int)deprecated
- func (x *WorkerConfig) GetBody() []byte
- func (x *WorkerConfig) GetCreate() string
- func (x *WorkerConfig) GetDescription() string
- func (x *WorkerConfig) GetDriver() string
- func (x *WorkerConfig) GetId() string
- func (x *WorkerConfig) GetName() string
- func (x *WorkerConfig) GetProfession() string
- func (x *WorkerConfig) GetUpdate() string
- func (x *WorkerConfig) GetVersion() string
- func (*WorkerConfig) ProtoMessage()
- func (x *WorkerConfig) ProtoReflect() protoreflect.Message
- func (x *WorkerConfig) Reset()
- func (x *WorkerConfig) String() string
Constants ¶
View Source
const ( EventInit = "init" EventSet = "set" EventReset = "reset" EventDel = "delete" )
View Source
const ( NamespaceProfession = "profession" NamespaceWorker = "worker" NamespaceExtender = "extender" NamespaceVariable = "variable" )
View Source
const ( //ProcessMaster master进程,守护进程 ProcessMaster = "master" //ProcessWorker worker进程,负责网关主流程的执行 ProcessWorker = "worker" //ProcessHelper helper进程,临时进程,用于检测插件下载操作 ProcessHelper = "helper" //ProcessAdmin admin进程,缓存配置信息,常驻进程 ProcessAdmin = "admin" )
Variables ¶
View Source
var ( ErrorDriverNotExist = errors.New("driver not exist") ErrorProfessionNotExist = errors.New("profession not exist") ErrorNotAllowCreateForSingleton = errors.New("not allow create for singleton profession") ErrorWorkerNotExits = errors.New("worker-data not exits") ErrorWorkerNotRunning = errors.New("worker-data not running") ErrorRegisterConflict = errors.New("conflict of register") ErrorNotGetSillForRequire = errors.New("not get skill for require") ErrorTargetNotImplementSkill = errors.New("require of skill not implement") ErrorParamsIsNil = errors.New("params is nil") ErrorParamNotExist = errors.New("not exist") ErrorStoreReadOnly = errors.New("store read only") ErrorRequire = errors.New("require") ErrorProfessionDependencies = errors.New("profession dependencies not complete") ErrorConfigIsNil = errors.New("config is nil") ErrorConfigFieldUnknown = errors.New("unknown type") ErrorConfigType = errors.New("error config type") )
View Source
var ( ProfessionConfig_ProfessionMod_name = map[int32]string{ 0: "Worker", 1: "Singleton", } ProfessionConfig_ProfessionMod_value = map[string]int32{ "Worker": 0, "Singleton": 1, } )
Enum value maps for ProfessionConfig_ProfessionMod.
View Source
var (
ErrorUnsupportedKind = errors.New("unsupported kind")
)
View Source
var File_message_proto protoreflect.FileDescriptor
View Source
var Namespaces = []string{ NamespaceProfession, NamespaceWorker, NamespaceExtender, }
Functions ¶
func ReadStringFromEntry ¶
func ToWorkerId ¶
Types ¶
type DriverConfig ¶
type DriverConfig struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Label string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty"` Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` Params map[string]string `` /* 153-byte string literal not displayed */ // contains filtered or unexported fields }
func (*DriverConfig) Descriptor
deprecated
func (*DriverConfig) Descriptor() ([]byte, []int)
Deprecated: Use DriverConfig.ProtoReflect.Descriptor instead.
func (*DriverConfig) GetDesc ¶
func (x *DriverConfig) GetDesc() string
func (*DriverConfig) GetId ¶
func (x *DriverConfig) GetId() string
func (*DriverConfig) GetLabel ¶
func (x *DriverConfig) GetLabel() string
func (*DriverConfig) GetName ¶
func (x *DriverConfig) GetName() string
func (*DriverConfig) GetParams ¶
func (x *DriverConfig) GetParams() map[string]string
func (*DriverConfig) ProtoMessage ¶
func (*DriverConfig) ProtoMessage()
func (*DriverConfig) ProtoReflect ¶
func (x *DriverConfig) ProtoReflect() protoreflect.Message
func (*DriverConfig) Reset ¶
func (x *DriverConfig) Reset()
func (*DriverConfig) String ¶
func (x *DriverConfig) String() string
type ExtenderBuilder ¶
type ExtenderBuilder interface {
Register(register IExtenderDriverRegister)
}
type ExtenderRegister ¶
type ExtenderRegister struct {
// contains filtered or unexported fields
}
func NewExtenderRegister ¶
func NewExtenderRegister() *ExtenderRegister
func (*ExtenderRegister) GetDriver ¶
func (p *ExtenderRegister) GetDriver(name string) (IExtenderDriverFactory, bool)
func (*ExtenderRegister) RegisterExtenderDriver ¶
func (p *ExtenderRegister) RegisterExtenderDriver(name string, factory IExtenderDriverFactory) error
type ExtendersSettings ¶
type ExtendersSettings struct { Extenders map[string]string `` /* 159-byte string literal not displayed */ // contains filtered or unexported fields }
func (*ExtendersSettings) Descriptor
deprecated
func (*ExtendersSettings) Descriptor() ([]byte, []int)
Deprecated: Use ExtendersSettings.ProtoReflect.Descriptor instead.
func (*ExtendersSettings) GetExtenders ¶
func (x *ExtendersSettings) GetExtenders() map[string]string
func (*ExtendersSettings) ProtoMessage ¶
func (*ExtendersSettings) ProtoMessage()
func (*ExtendersSettings) ProtoReflect ¶
func (x *ExtendersSettings) ProtoReflect() protoreflect.Message
func (*ExtendersSettings) Reset ¶
func (x *ExtendersSettings) Reset()
func (*ExtendersSettings) String ¶
func (x *ExtendersSettings) String() string
type FormatterConfig ¶
type GzipFile ¶
type GzipFile struct { Name string `json:"name"` Type string `json:"type"` Size int `json:"size"` Data string `json:"data"` }
func (*GzipFile) DecodeData ¶
type IDataMarshaller ¶
type IExtenderConfigChecker ¶
type IExtenderDisable ¶ added in v1.15.3
type IExtenderDriver ¶
type IExtenderDriverFactory ¶
type IExtenderDriverManager ¶
type IExtenderDriverManager interface { IExtenderDriverRegister }
type IExtenderDriverRegister ¶
type IExtenderDriverRegister interface {
RegisterExtenderDriver(name string, factory IExtenderDriverFactory) error
}
type IExtenderDrivers ¶
type IExtenderDrivers interface {
GetDriver(name string) (IExtenderDriverFactory, bool)
}
type IFormatter ¶
IFormatter format config
type IFormatterFactory ¶
type IFormatterFactory interface {
Create(cfg FormatterConfig, extendCfg ...interface{}) (IFormatter, error)
}
type IMetricEntry ¶
type IProfession ¶
type IProfession interface { Drivers() []*DriverConfig GetDriver(name string) (*DriverConfig, bool) HasDriver(name string) bool AppendAttr() []string Mod() ProfessionConfig_ProfessionMod }
type IProfessions ¶
type IProfessions interface { Set(name string, profession *ProfessionConfig) error Delete(name string) error Reset([]*ProfessionConfig) Names() []string GetProfession(name string) (IProfession, bool) All() []*ProfessionConfig }
type IRegister ¶
type IRegister[T any] interface { Register(name string, obj T, force bool) error Get(name string) (T, bool) Del(name string) (T, bool) }
func NewRegister ¶
type IVariable ¶
type IVariable interface { SetByNamespace(namespace string, variables map[string]string) error GetByNamespace(namespace string) (map[string]string, bool) SetVariablesById(id string, variables []string) RemoveRequire(id string) Unmarshal(buf []byte, typ reflect.Type) (interface{}, []string, error) Check(namespace string, variables map[string]string) ([]string, IVariable, error) Get(id string) (string, bool) Len() int }
type IWorkerDestroy ¶
type IWorkerDestroy interface {
Destroy() error
}
type ProcessStatus ¶
type ProcessStatus struct { Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*ProcessStatus) Descriptor
deprecated
func (*ProcessStatus) Descriptor() ([]byte, []int)
Deprecated: Use ProcessStatus.ProtoReflect.Descriptor instead.
func (*ProcessStatus) GetData ¶
func (x *ProcessStatus) GetData() []byte
func (*ProcessStatus) GetMsg ¶
func (x *ProcessStatus) GetMsg() string
func (*ProcessStatus) GetStatus ¶
func (x *ProcessStatus) GetStatus() int32
func (*ProcessStatus) ProtoMessage ¶
func (*ProcessStatus) ProtoMessage()
func (*ProcessStatus) ProtoReflect ¶
func (x *ProcessStatus) ProtoReflect() protoreflect.Message
func (*ProcessStatus) Reset ¶
func (x *ProcessStatus) Reset()
func (*ProcessStatus) String ¶
func (x *ProcessStatus) String() string
type ProfessionConfig ¶
type ProfessionConfig struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` // Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` // Dependencies []string `protobuf:"bytes,4,rep,name=dependencies,proto3" json:"dependencies,omitempty"` AppendLabels []string `protobuf:"bytes,5,rep,name=appendLabels,proto3" json:"appendLabels,omitempty"` Drivers []*DriverConfig `protobuf:"bytes,6,rep,name=drivers,proto3" json:"drivers,omitempty"` Mod ProfessionConfig_ProfessionMod `protobuf:"varint,7,opt,name=mod,proto3,enum=service.ProfessionConfig_ProfessionMod" json:"mod,omitempty"` // contains filtered or unexported fields }
func (*ProfessionConfig) Descriptor
deprecated
func (*ProfessionConfig) Descriptor() ([]byte, []int)
Deprecated: Use ProfessionConfig.ProtoReflect.Descriptor instead.
func (*ProfessionConfig) GetAppendLabels ¶
func (x *ProfessionConfig) GetAppendLabels() []string
func (*ProfessionConfig) GetDependencies ¶
func (x *ProfessionConfig) GetDependencies() []string
func (*ProfessionConfig) GetDesc ¶
func (x *ProfessionConfig) GetDesc() string
func (*ProfessionConfig) GetDrivers ¶
func (x *ProfessionConfig) GetDrivers() []*DriverConfig
func (*ProfessionConfig) GetLabel ¶
func (x *ProfessionConfig) GetLabel() string
func (*ProfessionConfig) GetMod ¶
func (x *ProfessionConfig) GetMod() ProfessionConfig_ProfessionMod
func (*ProfessionConfig) GetName ¶
func (x *ProfessionConfig) GetName() string
func (*ProfessionConfig) ProtoMessage ¶
func (*ProfessionConfig) ProtoMessage()
func (*ProfessionConfig) ProtoReflect ¶
func (x *ProfessionConfig) ProtoReflect() protoreflect.Message
func (*ProfessionConfig) Reset ¶
func (x *ProfessionConfig) Reset()
func (*ProfessionConfig) String ¶
func (x *ProfessionConfig) String() string
type ProfessionConfig_ProfessionMod ¶
type ProfessionConfig_ProfessionMod int32
const ( ProfessionConfig_Worker ProfessionConfig_ProfessionMod = 0 ProfessionConfig_Singleton ProfessionConfig_ProfessionMod = 1 )
func (ProfessionConfig_ProfessionMod) Descriptor ¶
func (ProfessionConfig_ProfessionMod) Descriptor() protoreflect.EnumDescriptor
func (ProfessionConfig_ProfessionMod) Enum ¶
func (x ProfessionConfig_ProfessionMod) Enum() *ProfessionConfig_ProfessionMod
func (ProfessionConfig_ProfessionMod) EnumDescriptor
deprecated
func (ProfessionConfig_ProfessionMod) EnumDescriptor() ([]byte, []int)
Deprecated: Use ProfessionConfig_ProfessionMod.Descriptor instead.
func (ProfessionConfig_ProfessionMod) Number ¶
func (x ProfessionConfig_ProfessionMod) Number() protoreflect.EnumNumber
func (ProfessionConfig_ProfessionMod) String ¶
func (x ProfessionConfig_ProfessionMod) String() string
func (ProfessionConfig_ProfessionMod) Type ¶
func (ProfessionConfig_ProfessionMod) Type() protoreflect.EnumType
type ProfessionConfigs ¶
type ProfessionConfigs struct { Data []*ProfessionConfig `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*ProfessionConfigs) Descriptor
deprecated
func (*ProfessionConfigs) Descriptor() ([]byte, []int)
Deprecated: Use ProfessionConfigs.ProtoReflect.Descriptor instead.
func (*ProfessionConfigs) GetData ¶
func (x *ProfessionConfigs) GetData() []*ProfessionConfig
func (*ProfessionConfigs) ProtoMessage ¶
func (*ProfessionConfigs) ProtoMessage()
func (*ProfessionConfigs) ProtoReflect ¶
func (x *ProfessionConfigs) ProtoReflect() protoreflect.Message
func (*ProfessionConfigs) Reset ¶
func (x *ProfessionConfigs) Reset()
func (*ProfessionConfigs) String ¶
func (x *ProfessionConfigs) String() string
type SettingMode ¶
type SettingMode int
const ( SettingModeReadonly SettingMode = iota SettingModeSingleton SettingModeBatch )
type TWorker ¶
type TWorker struct { Id string `json:"id,omitempty" yaml:"id"` Name string `json:"name,omitempty" yaml:"name"` Driver string `json:"driver,omitempty" yaml:"driver"` Profession string `json:"profession,omitempty" yaml:"profession"` Create time.Time `json:"create" yaml:"create"` Update time.Time `json:"update" yaml:"update"` Data interface{} `json:"data,omitempty" yaml:"data"` }
type Untyped ¶
type Untyped[K comparable, T any] interface { Set(k K, v T) Get(k K) (T, bool) Del(k K) (T, bool) Dels(k ...K) []T List() []T Keys() []K All() map[K]T Clone() Untyped[K, T] Count() int }
func BuildUntyped ¶
func BuildUntyped[K comparable, T any]() Untyped[K, T]
type WorkerConfig ¶
type WorkerConfig struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Profession string `protobuf:"bytes,2,opt,name=profession,proto3" json:"profession,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Driver string `protobuf:"bytes,4,opt,name=driver,proto3" json:"driver,omitempty"` Create string `protobuf:"bytes,5,opt,name=create,proto3" json:"create,omitempty"` Update string `protobuf:"bytes,6,opt,name=update,proto3" json:"update,omitempty"` Body []byte `protobuf:"bytes,7,opt,name=body,proto3" json:"body,omitempty"` Description string `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"` Version string `protobuf:"bytes,9,opt,name=version,proto3" json:"version,omitempty"` // contains filtered or unexported fields }
func GenInitWorkerConfig ¶
func GenInitWorkerConfig(ps []*ProfessionConfig) []*WorkerConfig
func (*WorkerConfig) Descriptor
deprecated
func (*WorkerConfig) Descriptor() ([]byte, []int)
Deprecated: Use WorkerConfig.ProtoReflect.Descriptor instead.
func (*WorkerConfig) GetBody ¶
func (x *WorkerConfig) GetBody() []byte
func (*WorkerConfig) GetCreate ¶
func (x *WorkerConfig) GetCreate() string
func (*WorkerConfig) GetDescription ¶
func (x *WorkerConfig) GetDescription() string
func (*WorkerConfig) GetDriver ¶
func (x *WorkerConfig) GetDriver() string
func (*WorkerConfig) GetId ¶
func (x *WorkerConfig) GetId() string
func (*WorkerConfig) GetName ¶
func (x *WorkerConfig) GetName() string
func (*WorkerConfig) GetProfession ¶
func (x *WorkerConfig) GetProfession() string
func (*WorkerConfig) GetUpdate ¶
func (x *WorkerConfig) GetUpdate() string
func (*WorkerConfig) GetVersion ¶
func (x *WorkerConfig) GetVersion() string
func (*WorkerConfig) ProtoMessage ¶
func (*WorkerConfig) ProtoMessage()
func (*WorkerConfig) ProtoReflect ¶
func (x *WorkerConfig) ProtoReflect() protoreflect.Message
func (*WorkerConfig) Reset ¶
func (x *WorkerConfig) Reset()
func (*WorkerConfig) String ¶
func (x *WorkerConfig) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.