ConfigServer

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SConf     *Configurator
	OldConf   MPB.Config
	CurRouter *MPB.Server
	CurGame   *MPB.Server
	CurGate   *MPB.Server
)
View Source
var (
	Conf = make(map[string]*Configurator)
)

Functions

func GetConf added in v1.0.8

func GetConf(path ...string) string

func InitClient added in v1.1.0

func InitClient(filename string, ServerID string)

func ReadFile added in v1.1.3

func ReadFile(fpath string, cur interface{})

func Server

func Server(c *Configurator)

func WriteFile added in v1.1.1

func WriteFile(fpath string, cur interface{})

Types

type Api_toml added in v1.1.0

type Api_toml struct{}

func (*Api_toml) Read added in v1.1.0

func (*Api_toml) Read(fpath string, v interface{})

func (*Api_toml) Write added in v1.1.0

func (*Api_toml) Write(fpath string, v interface{})

type Api_yaml added in v1.1.0

type Api_yaml struct{}

func (*Api_yaml) Read added in v1.1.0

func (*Api_yaml) Read(fpath string, v interface{})

func (*Api_yaml) Write added in v1.1.0

func (*Api_yaml) Write(fpath string, v interface{})

type Basic added in v1.0.8

type Basic struct {
	sync.RWMutex
	Isdirty bool
}

type Configurator

type Configurator struct {
	sync.RWMutex

	Conf       config.Config
	Update     func(*Configurator)
	Opt        *Options
	ServerName string
	MyConf     MPB.Config
	// contains filtered or unexported fields
}

configurator 配置器

func New

func New(name string, source source.Source, update func(*Configurator)) *Configurator

type Option

type Option func(o *Options)

func WithSource

func WithSource(src source.Source) Option

type Options

type Options struct {
	Apps    map[string]interface{}
	Sources []source.Source
}

type Service

type Service struct{}

func (Service) Read

func (s Service) Read(ctx context.Context, req *MPB.ReadRequest, rsp *MPB.ReadResponse) (err error)

func (Service) Watch

func (s Service) Watch(ctx context.Context, req *MPB.WatchRequest, server MPB.Config_WatchStream) (err error)

Jump to

Keyboard shortcuts

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