config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: Apache-2.0 Imports: 7 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// Name - plugin's executable name, must be the same as in `Makefile`
	Name = "nexentastor-docker-volume-plugin"

	// PluginMountPointsRoot - path inside the plugin container to mount volumes
	// this path must be propagated to host via "propogatedmount" parameter in plugin's "config.json"
	// TODO read this parameter from plugin's "config.json" file "propogatedmount" parameter?
	PluginMountPointsRoot = "/mnt/nexentastor-docker-volume-plugin"

	// path to a log file inside the plugin's container
	LogFile = "/var/log/nexentastor-docker-volume-plugin.log"
)

persistent plugin's config

View Source
const (
	// FsTypeNFS - to mount NS filesystem over NFS
	FsTypeNFS string = "nfs"
)

supported mount filesystem types

Variables

View Source
var Commit string

Commit - plugin last commit, to set commit set flags: go build -ldflags "-X github.com/Nexenta/nexentastor-docker-volume-plugin/pkg/config.Commit=..."

View Source
var DateTime string

DateTime - plugin build datetime, to set commit set flags: go build -ldflags "-X github.com/Nexenta/nexentastor-docker-volume-plugin/pkg/config.DateTime=..."

View Source
var Version string

Version - plugin version, to set version set flags: go build -ldflags "-X github.com/Nexenta/nexentastor-docker-volume-plugin/pkg/config.Version=1.0.0"

Functions

This section is empty.

Types

type Config

type Config struct {
	Address             string `yaml:"restIp"`
	Username            string `yaml:"username"`
	Password            string `yaml:"password"`
	DefaultDataset      string `yaml:"defaultDataset,omitempty"`
	DefaultDataIP       string `yaml:"defaultDataIp,omitempty"`
	Debug               bool   `yaml:"debug,omitempty"`
	DefaultMountOptions string `yaml:"defaultMountOptions,omitempty"`
	// contains filtered or unexported fields
}

Config - plugin config from file

func New

func New(configFilePath string) (*Config, error)

New creates config instance

func (*Config) GetFilePath

func (c *Config) GetFilePath() string

GetFilePath gets filepath of found config file

func (*Config) Refresh

func (c *Config) Refresh() (changed bool, err error)

Refresh reads and validates config, returns `true` if config has been changed

func (*Config) Validate

func (c *Config) Validate() error

Validate validates current config

Jump to

Keyboard shortcuts

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