config

package
v0.0.0-...-8dc1d63 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TimeRemaining

func TimeRemaining(t time.Time) string

TimeRemaining .

Types

type Config

type Config struct {
	Prefix string
	// contains filtered or unexported fields
}

Config .

func NewConfig

func NewConfig(l tool.ILogger, store tool.IStorage) Config

NewConfig .

func (Config) ChangePassword

func (c Config) ChangePassword(f File, passphrase *validate.Passphrase)

ChangePassword will change the config password.

func (Config) Load

func (c Config) Load() (File, *validate.Passphrase, error)

Load the app configuration file.

func (Config) Login

func (c Config) Login(f File, passphrase *validate.Passphrase)

Login .

func (Config) LoginTest

func (c Config) LoginTest(f File, passphrase *validate.Passphrase)

LoginTest .

func (Config) Logout

func (c Config) Logout(f File, prefixList []string, passphrase *validate.Passphrase)

Logout .

func (Config) Push

func (c Config) Push(f File, prefixList []string, from string, to string,
	src tool.IStorage, dst tool.IStorage, passphrase *validate.Passphrase)

Push .

func (Config) SendSMS

func (c Config) SendSMS(f File, passphrase *validate.Passphrase)

SendSMS will send a text message via AWS SNS.

func (Config) SetStorageAWS

func (c Config) SetStorageAWS(f File)

SetStorageAWS will set the AWS storage.

func (Config) SetStorageFilesystem

func (c Config) SetStorageFilesystem(f File)

SetStorageFilesystem will set the storage to the filesystem.

func (Config) View

func (c Config) View(f File, passphrase *validate.Passphrase)

View will output the application settings..

type File

type File struct {
	ID      string  `json:"id"`
	Login   Login   `json:"login"`
	Storage Storage `json:"storage"`
}

File is the demostack config file.

func (File) Decrypted

func (f File) Decrypted(passphrase *validate.Passphrase) File

Decrypted .

func (File) Encrypted

func (f File) Encrypted(passphrase *validate.Passphrase) File

Encrypted .

type Filesystem

type Filesystem struct{}

Filesystem is for the local filesystem.

type Login

type Login struct {
	Host     string `json:"host"`
	Username string `json:"username"`
}

Login holds the login credentials.

type Storage

type Storage struct {
	// Current supports the following values: filesystem, aws.
	Current    string         `json:"current"`
	AWS        awslib.Storage `json:"aws"`
	Filesystem Filesystem     `json:"filesystem"`
}

Storage is the storage of the config files.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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