config

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfigOptions = &Options{
	Key:        utils.NewUUIDString(),
	IsMaster:   utils.IsMaster(),
	AuthKey:    constants.DefaultGrpcAuthKey,
	MaxRunners: 0,
}
View Source
var DefaultMaxRunner = 8

Functions

func NewNodeConfigService

func NewNodeConfigService(opts ...Option) (svc2 interfaces.NodeConfigService, err error)

func ProvideConfigService

func ProvideConfigService(path string) func() (interfaces.NodeConfigService, error)

Types

type Config

type Config entity.NodeInfo

func NewConfig

func NewConfig(opts *Options) (cfg *Config)

type Option

type Option func(svc interfaces.NodeConfigService)

func WithConfigPath

func WithConfigPath(path string) Option

type Options

type Options struct {
	Key        string
	Name       string
	IsMaster   bool
	AuthKey    string
	MaxRunners int
}

type Service

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

func (*Service) GetAuthKey

func (svc *Service) GetAuthKey() (res string)

func (*Service) GetBasicNodeInfo

func (svc *Service) GetBasicNodeInfo() (res interfaces.Entity)

func (*Service) GetConfigPath

func (svc *Service) GetConfigPath() (path string)

func (*Service) GetMaxRunners

func (svc *Service) GetMaxRunners() (res int)

func (*Service) GetNodeKey

func (svc *Service) GetNodeKey() (res string)

func (*Service) GetNodeName

func (svc *Service) GetNodeName() (res string)

func (*Service) Init

func (svc *Service) Init() (err error)

func (*Service) IsMaster

func (svc *Service) IsMaster() (res bool)

func (*Service) Reload

func (svc *Service) Reload() (err error)

func (*Service) SetConfigPath

func (svc *Service) SetConfigPath(path string)

Jump to

Keyboard shortcuts

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