pkg

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Error_RepeateRegisterStore ...
	Error_RepeateRegisterStore = errors.New("RepeateRegisterStore")
	// Error_AppConfigNotFound ...
	Error_AppConfigNotFound = errors.New("AppConfigNotFound")
	// Error_AppConfigByFilterNotFound ...
	Error_AppConfigByFilterNotFound = errors.New("AppConfigByFilterNotFound")
	// Error_ParserAppConfigFail ...
	Error_ParserAppConfigFail = errors.New("ParserAppConfigFail")
)
View Source
var (

	// Cancel ...
	Cancel context.CancelFunc
)

Functions

func CheckConfigSchema

func CheckConfigSchema(config string, schema string) (bool, error)

func EndMconfig

func EndMconfig() func()

EndMconfig ...

func GetConfigFromCache

func GetConfigFromCache(key Appkey, filters *sdk.ConfigFilters) ([]*sdk.Config, error)

GetConfigFromCache ...

func GetConfigFromStore

func GetConfigFromStore(key Appkey, filters *sdk.ConfigFilters) ([]*sdk.Config, error)

GetConfigFromStore ...

func InitMconfig

func InitMconfig(mconfig *MConfig) func()

InitMconfig ...

func InitStore

func InitStore(store_type, store_address string)

InitStore ...

func RegisterStorePlugin

func RegisterStorePlugin(name string, init func(address string) (AppConfigStore, error))

RegisterStorePlugin ...

Types

type AppConfigStore

type AppConfigStore interface {
	GetAppConfigs(key string) (AppConfigsJSONStr, int64, error)
	PutAppConfigs(key string, value AppConfigsJSONStr) error
	WatchAppConfigs(key string, rev int64, ctx context.Context) (chan *ConfigEvent, error)
	WatchAppConfigsWithPrefix(ctx context.Context) (chan *ConfigEvent, error)
}

AppConfigStore ...

type AppConfigs

type AppConfigs map[string]*Configs

AppConfigs ...

type AppConfigsJSONStr

type AppConfigsJSONStr string

AppConfigsJSONStr ...

type AppConfigsMap

type AppConfigsMap struct {
	AppConfigs
	// contains filtered or unexported fields
}

AppConfigsMap ...

type Appkey

type Appkey string

Appkey ...

type Client

type Client struct {
	Id      ClientId
	MsgChan chan interface{}
}

Client ...

func NewClient

func NewClient() (*Client, error)

NewClient ...

type ClientChanMap

type ClientChanMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ClientChanMap ...

func (*ClientChanMap) AddClient

func (ch *ClientChanMap) AddClient(clientId ClientId, appid Appkey, clientMsgChan chan interface{})

AddClient ...

func (*ClientChanMap) GetClientsChan

func (ch *ClientChanMap) GetClientsChan(appid Appkey) []chan interface{}

GetClientsChan ...

func (*ClientChanMap) RemoveClient

func (ch *ClientChanMap) RemoveClient(clientId ClientId, appid Appkey)

RemoveClient ...

type ClientId

type ClientId int32

ClientId ...

type Config

type Config struct {
	Schema     string `json:"schema"`
	Config     string `json:"config"`
	CreateTime int64  `json:"create_time"`
	UpdateTime int64  `json:"update_time"`
}

Config ...

type ConfigEvent

type ConfigEvent struct {
	Key       Appkey
	Value     AppConfigsJSONStr
	EventType EventType
}

ConfigEvent ...

type Configs

type Configs struct {
	Configs    ConfigsMap        `json:"configs"`
	Desc       string            `json:"desc"`
	CreateTime int64             `json:"create_time"`
	UpdateTime int64             `json:"update_time"`
	ABFilters  map[string]string `json:"ABFilters"`
}

Configs ...

type ConfigsMap

type ConfigsMap struct {
	Entry map[string]*Config `json:"entry"`
	// contains filtered or unexported fields
}

ConfigsMap ...

type EventType

type EventType int

EventType ...

var Event_Delete EventType = 1

Event_Delete ...

var Event_Update EventType = 0

Event_Update ...

type MConfig

type MConfig struct {
	Namspace        *string
	RegistryAddress *string
	RegistryType    *string
	StoreAddress    *string
	StoreType       *string
	ServerIp        *string
	ServerPort      *int
}

MConfig ...

type MConfigCLI

type MConfigCLI struct {
}

MConfigCLI ...

func NewMConfigCLI

func NewMConfigCLI() *MConfigCLI

NewMConfigCLI ...

func (*MConfigCLI) DeleteMconfigApp

func (M *MConfigCLI) DeleteMconfigApp(ctx context.Context, request *cli.DeleteMconfigAppRequest) (*cli.DeleteMconfigAppResponse, error)

DeleteMconfigApp ...

func (*MConfigCLI) DeleteMconfigConfig

DeleteMconfigConfig ...

func (*MConfigCLI) InitMconfigApp

func (M *MConfigCLI) InitMconfigApp(ctx context.Context, request *cli.InitMconfigAppRequest) (*cli.InitMconfigAppResponse, error)

InitMconfigApp ...

func (*MConfigCLI) PutMconfigConfig

func (M *MConfigCLI) PutMconfigConfig(ctx context.Context, request *cli.PutMconfigRequest) (*cli.PutMconfigResponse, error)

PutMconfigConfig ...

func (*MConfigCLI) UpdateMconfigApp

func (M *MConfigCLI) UpdateMconfigApp(ctx context.Context, request *cli.UpdateMconfigAppRequest) (*cli.UpdateMconfigAppResponse, error)

UpdateMconfigApp ...

type MConfigSDK

type MConfigSDK struct {
}

MConfigSDK ...

func NewMConfigSDK

func NewMConfigSDK() *MConfigSDK

NewMConfigSDK ...

func (*MConfigSDK) GetVStream

func (m *MConfigSDK) GetVStream(stream sdk.MConfig_GetVStreamServer) error

GetVStream ...

type MconfigCache

type MconfigCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MconfigCache ...

type StorePlugin

type StorePlugin struct {
	Name string
	Init func(address string) (AppConfigStore, error)
}

StorePlugin ...

func NewStorePlugin

func NewStorePlugin(name string, init func(address string) (AppConfigStore, error)) *StorePlugin

NewStorePlugin ...

Directories

Path Synopsis
plugin

Jump to

Keyboard shortcuts

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