config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package config provides basic configuration plumbing.

Index

Constants

This section is empty.

Variables

View Source
var GetConf = func() *Config {
	if sConf == nil {
		Reload()
	}

	return sConf
}

GetConf will get the configuration settings for the MServ server. Subsequent calls will NOT refresh the settings if they have since changed. For that to happen, call Reload first.

View Source
var GetSubConf = func(in interface{}, envTag string) error {
	if err := envconfig.Process(envTag, in); err != nil {
		log.WithError(err).Fatal("failed to process config env vars")
	}

	if err := json.Unmarshal(conf.ReadConf(), in); err != nil {
		return fmt.Errorf("failed to unmarshal mserv driver config: %w", err)
	}

	return nil
}

GetConf will get the config data for the Momo Driver

Functions

func Reload

func Reload()

Reload the configuration settings from environment and file, in that order.

Types

type AWSS3

type AWSS3 struct {
	ConfigAccessKeyID string
	ConfigSecretKey   string
	ConfigRegion      string
}

type Config

type Config struct {
	Mserv MservConf
}

type FileStorage

type FileStorage struct {
	S3    *AWSS3
	Local *LocalStore
	Kind  string `default:"local"`
}

type LocalStore

type LocalStore struct {
	ConfigKeyPath string `default:"/tmp/mserv/filestore-local"`
}

type MservConf

type MservConf struct {
	StorageTag string
	StoreType  StorageDriver

	AllowHttpInvocation bool
	HTTPAddr            string `default:":8989"`

	GrpcServer struct {
		Address string
		Enabled bool
	}

	PublicKeyPath  string
	MiddlewarePath string `default:"/tmp/mserv/middleware"`
	PluginDir      string `default:"/tmp/mserv/plugins"`

	RetainUploads bool

	FileStore *FileStorage
}

MservConf describes the settings required for an Mserv instance

type StorageDriver

type StorageDriver string

Jump to

Keyboard shortcuts

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