config

package
v0.0.0-...-9a8ef1a Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DATABASE  = "meta.db"
	ARTIFACTS = "artifacts"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	HttpListen  string           `yaml:"http_listen,omitempty"`
	HttpsListen string           `yaml:"https_listen,omitempty"`
	HttpsKey    string           `yaml:"https_key,omitempty"`
	HttpsCert   string           `yaml:"https_cert,omitempty"`
	DataDir     string           `yaml:"datadir,omitempty"`
	Users       UserList         `yaml:"users,omitempty"`
	Agents      []agent.Agent    `yaml:"agents,omitempty"`
	Projects    []*model.Project `yaml:"projects,omitempty"`
	// contains filtered or unexported fields
}

func Load

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

func (*Config) GetArtifactsDir

func (c *Config) GetArtifactsDir() string

Returns the artifacts directory.

func (*Config) GetDatabaseFile

func (c *Config) GetDatabaseFile() string

Returns the path to the database file.

func (*Config) GetProject

func (c *Config) GetProject(id int) *model.Project

Returns a project by its ID.

func (*Config) IsAuthEnabled

func (c *Config) IsAuthEnabled() bool

Returns true if user authentication is enabled.

func (*Config) IsHttpEnabled

func (c *Config) IsHttpEnabled() bool

Returns true if http server is enabled.

func (*Config) IsHttpsEnabled

func (c *Config) IsHttpsEnabled() bool

Returns true if ssl encrypted http(s) server is enabled.

func (*Config) Save

func (c *Config) Save() error

Saves the configuration file to the filesystem.

func (*Config) Setup

func (c *Config) Setup()

type UserList

type UserList map[string]string

A list of users.

func (UserList) Verify

func (l UserList) Verify(user string, password string) bool

Returns true if the given user / password combination is valid.

Jump to

Keyboard shortcuts

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