Documentation ¶
Index ¶
- Constants
- Variables
- func Delete(obj Object) error
- func DeleteConfigs(ids []string) error
- func DeleteObjects(objs []Object) error
- func Error(message string) error
- func ErrorE(message string, err error) error
- func ErrorEF(message string, err error, fields log.Fields) error
- func ErrorF(message string, fields log.Fields) error
- func EtcdClient() (*clientv3.Client, error)
- func EtcdConnect() (*clientv3.Client, error)
- func GRPCServerOptions() []grpc.ServerOption
- func GetConfigs(ids []string) ([]*api.MachineConfig, error)
- func InitLogging(logname string)
- func IsTxnFailed(err error) bool
- func ListConfigs() (map[string]*api.Config, error)
- func Prepare(rq *api.ForgeRequest) (*api.MachineConfig, error)
- func Read(obj Object) error
- func ReadNew(obj Object) error
- func ReadObjects(objs []Object) (error, int)
- func RunObjectTx(otx ObjectTx) error
- func SetConfigs(configs []*api.MachineConfig) error
- func TxnFailed(message string) error
- func Write(obj Object, opts ...etcd.OpOption) error
- func WriteObjects(objs []Object, opts ...etcd.OpOption) error
- type Config
- type Object
- type ObjectTx
- type TlsConfig
Constants ¶
View Source
const (
TxnFailedPrefix = "txn failed"
)
Variables ¶
View Source
var (
MaxMessageSize = 4 * 1024 * 1024
)
View Source
var NotFound error = fmt.Errorf("not found")
View Source
var (
// Version is the package version
Version = "undefined"
)
Functions ¶
func DeleteConfigs ¶
DeleteConfigs removes the machine configuration from the datastore
func DeleteObjects ¶
func ErrorE ¶
Encapsulate err in a structured log and return an abstracted high-level error with message as the payload
func ErrorEF ¶
Encapsulate fields and err in a structured log and return an abstracted high-level error with message as the payload
func ErrorF ¶
Encapsulate fields in a structured log and return an abstracted high-level error with message as the payload
func EtcdClient ¶
func EtcdConnect ¶
Try up to 10 times to connect to etcd
func GRPCServerOptions ¶ added in v0.3.2
func GRPCServerOptions() []grpc.ServerOption
func GetConfigs ¶
func GetConfigs(ids []string) ([]*api.MachineConfig, error)
GetConfigs retrieves the configuration from the datastore
func InitLogging ¶
func InitLogging(logname string)
func IsTxnFailed ¶
func ListConfigs ¶
ListConfigs retrieves all machine configurations from the datastore
func Prepare ¶
func Prepare(rq *api.ForgeRequest) (*api.MachineConfig, error)
func ReadObjects ¶
func RunObjectTx ¶
func SetConfigs ¶
func SetConfigs(configs []*api.MachineConfig) error
SetConfigs configures foundry's datastore with machine configuration
Types ¶
type Config ¶
type Config struct { ManageEndpoint string `yaml:"manage_endpoint"` EtcdEndpoint string `yaml:"etcd_endpoint"` EtcdTls *TlsConfig `yaml:"etcd_tls"` }
func LoadConfig ¶
func LoadConfig() *Config
func ServerConfig ¶
func ServerConfig() *Config
Click to show internal directories.
Click to hide internal directories.