driver

package
v1.8.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package driver provide the implementation of config driver used in CfgManager

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
}

Database - Used to load/save configuration in database

func (*Database) Load

func (d *Database) Load() (map[string]interface{}, error)

Load - load config from database, only user setting will be load from database.

func (*Database) Save

func (d *Database) Save(cfgs map[string]interface{}) error

Save - Only save user config items in the cfgs map

type Driver

type Driver interface {
	// Load - load config item from config driver
	Load() (map[string]interface{}, error)
	// Save - save config item into config driver
	Save(cfg map[string]interface{}) error
}

Driver the interface to save/load config

type RESTDriver

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

RESTDriver - config store driver based on REST API

func NewRESTDriver

func NewRESTDriver(configRESTURL string, modifiers ...modifier.Modifier) *RESTDriver

NewRESTDriver - Create RESTDriver

func (*RESTDriver) Load

func (h *RESTDriver) Load() (map[string]interface{}, error)

Load - load config data from REST server

func (*RESTDriver) Save

func (h *RESTDriver) Save(cfgMap map[string]interface{}) error

Save - Save config data to REST server by PUT method

Jump to

Keyboard shortcuts

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