configure

package
v0.0.0-...-51d629d Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2016 License: BSD-3-Clause, BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_CONFIG = `` /* 253-byte string literal not displayed */

Defaults are some simple defaults that allow configuration to be a bit easier for a new setup.

View Source
const PASSWORD_MINIMUM_LENGTH = 6
View Source
const TIMESTAMP_EXPIRATION = 120 // seconds
View Source
const USER_TIME_STR = time.RFC3339

Variables

View Source
var UnixTimeZero = time.Unix(0, 0)

Functions

This section is empty.

Types

type Configure

type Configure struct {
	Service Service
	User    Store `help:"The storage for the user data"`
	Client  Store `help:"The storage for the client can be different than for the user store"`
	Encrypt Encrypt
}

Configure is the main structure holding the parameters, split up for each logical section.

func New

func New() *Configure

New will generate a new configuration with no options defined.

func NewConfigure

func NewConfigure(encodedConfig string) (*Configure, error)

Create a configuration and decode the contents of the string passed.

func (*Configure) DecodeString

func (c *Configure) DecodeString(encodedConfig string) error

func (*Configure) Default

func (c *Configure) Default()

Default will fill in a configuration with some basic, sensible defaults. It is used primarly during setup to "kick start" the cli setup routines.

func (*Configure) String

func (c *Configure) String() string

String will return a clean, indented version of the configuration.

type Configurer

type Configurer interface {
	DecodeString(string) error
	String() string
}

type Encrypt

type Encrypt struct {
	Name    string `help:"The encryption driver you want to use." name:"Encryption Name"`
	Options string `help:"Options passed to the driver. Check the driver for what options are availble." name:"Driver options"`
}

Encrypt gives the name and options for the password encryption driver

type Service

type Service struct {
	Host        string `name:"Hostname for requests" help:"The IP address or host name to listen on. Leave empty to listen to all."`
	Port        int    `name:"Port# for requests"    help:"The port that the service should listen on."`
	ClientId    string `` /* 145-byte string literal not displayed */
	ClientStore bool   `name:"Separate client store" help:"Do you want separate client and user storage?"`
}

Service is the structure used to define how the services are loaded and general options for the program.

type Store

type Store struct {
	Name    string `help:"The storage driver you want to use." name:"Storage Name"`
	Dsn     string `help:"The specific driver data-name. Usually how to connect to the database." name:"DSN"`
	Options string `help:"Options passed to the driver. Check the driver for what options are availble." name:"Driver options"`
}

Store is the structure that is used to define storage parameters.

Jump to

Keyboard shortcuts

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