config

package
v0.0.0-...-5d4f8f2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ConfigVarsEnvName               = "HF_SERVER_CONFIG_VARS"
	ConfigPathEnvName               = "HF_SERVER_CONFIG_PATH"
	GCS               StorageTarget = "GCS"
	S3                StorageTarget = "S3"
	Bolt              DbTarget      = "BOLT"
	Postgres          DbTarget      = "POSTGRES"
	Badger            DbTarget      = "BADGER"
)

Variables

View Source
var (
	DefaultDataDirPath    = "/var/tmp/hflow.db"
	DefaultDBBucket       = "hflow_master"
	DefaultStorageBucket  = "hyperflow"
	DefaultStorageTarget  = GCS
	DefaultStorageBaseDir = "hyperflow"
	DefaultMasterPort     = int32(8888)
	ConfigFilePerm        = 0644
)

Functions

This section is empty.

Types

type Config

type Config struct {
	PublicInterface    string
	MasterIp           string
	MasterPort         int32
	MasterExternalPort int32
	NoSSL              bool

	DB         *DBConfig
	K8         *KubeConfig
	ObjStorage *ObjStorageConfig

	LogLevel string
	LogPath  string
}

func NewConfig

func NewConfig(listenIp, listenPort, p string) (*Config, error)

func NewConfigFromJson

func NewConfigFromJson(cString string) (c *Config, fnerr error)

func NewConfigFromPath

func NewConfigFromPath(p string) (*Config, error)

func NewDefaultConfig

func NewDefaultConfig(masterIp string, masterPort int32) (*Config, error)

func SaveConfig

func SaveConfig(c *Config, p string) (*Config, error)

func (*Config) GetListenAddr

func (c *Config) GetListenAddr() string

type DBConfig

type DBConfig struct {
	Driver      DbTarget // POSTGRES, BOLT
	Name        string
	User        string
	Pass        string
	DataDirPath string
}

type DbTarget

type DbTarget string

type GcsConfig

type GcsConfig struct {
	CredsPath string
	Bucket    string
	Creds     []byte
}

type KubeConfig

type KubeConfig struct {
	Namespace string
	Path      string
	InCluster bool
}

type ObjStorageConfig

type ObjStorageConfig struct {
	StorageTarget StorageTarget
	BaseDir       string
	S3            *S3Config
	Gcs           *GcsConfig
}

type S3Config

type S3Config struct {
	CredPath     string
	AccessKey    string
	SecretKey    string
	SessionToken string
	Bucket       string
	Region       string
	Creds        string
}

type StorageTarget

type StorageTarget string

Jump to

Keyboard shortcuts

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