config

package
v0.0.0-...-4f3b87e Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package config contains how to get/save config parameters from file.

Index

Constants

View Source
const (
	// ConfigFileName is the name of config file
	ConfigFileName = "config.json"
)

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

ConfigDir returns the directory the configuration file is stored in

Types

type BackendStorage

type BackendStorage struct {
	DeviceID uint64 `json:"deviceID"`
	Path     string `json:"path"`
	Online   bool   `json:"online"`
}

type Config

type Config struct {
	Storages     []BackendStorage       `json:"storages"`
	ISCSIPortals []ISCSIPortalInfo      `json:"iscsiportals"`
	ISCSITargets map[string]ISCSITarget `json:"iscsitargets"`
}

func GetConfig

func GetConfig() *Config

func Load

func Load(configDir string) (*Config, error)

Load reads the configuration files in the given directory and return values.

func (*Config) Save

func (config *Config) Save(filename string) error

Save encodes and writes out all the authorization information

type ISCSIPortalInfo

type ISCSIPortalInfo struct {
	ID     uint16 `json:"id"`
	Portal string `json:"portal"`
}

type ISCSITarget

type ISCSITarget struct {
	TPGTs map[string][]uint64 `json:"tpgts"`
	LUNs  map[string]uint64   `json:"luns"`
}

Jump to

Keyboard shortcuts

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