config

package
v0.0.0-...-02502d4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: Apache-2.0 Imports: 8 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LocalStore string         `json:"local_store"`
	HookSvr    *HookSvrConfig `json:"webhook"`
	Repos      []*Repo        `json:"repos"`
	Consul     *ConsulConfig  `json:"consul"`
}

Config is used to represent the passed in configuration

func Load

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

Load maps the configuration provided from a file to a Configuration object

type ConsulConfig

type ConsulConfig struct {
	Address   string `json:"address"`
	Token     string `json:"token,omitempty"`
	SSLEnable bool   `json:"ssl"`
	SSLVerify bool   `json:"ssl_verify,omitempty"`
}

ConsulConfig is the configuration for the Consul client

type Credentials

type Credentials struct {
	Username   string     `json:"username,omitempty"`
	Password   string     `json:"password,omitempty"`
	PrivateKey PrivateKey `json:"private_key,omitempty"`
}

Credentials is the representation of git authentication

type Hook

type Hook struct {
	Type string `json:"type"`

	// Specific to polling
	Interval time.Duration `json:"interval"`

	// Specific to webhooks
	URL string `json:"url,omitempty"`
}

Hook is the configuration for hooks

type HookSvrConfig

type HookSvrConfig struct {
	Address string `json:"address,omitempty"`
	Port    int    `json:"port"`
}

HookSvrConfig is the configuration for the git hoooks server

type PrivateKey

type PrivateKey struct {
	Key      string `json:"pk_key"`
	Username string `json:"pk_username,omitempty"`
	Password string `json:"pk_password,omitempty"`
}

PrivateKey is the representation of private key used for the authentication

type Repo

type Repo struct {
	Name           string      `json:"name"`
	URL            string      `json:"url"`
	Branches       []string    `json:"branches"`
	Hooks          []*Hook     `json:"hooks"`
	SourceRoot     string      `json:"source_root"`
	MountPoint     string      `json:"mount_point"`
	ExpandKeys     bool        `json:"expand_keys,omitempty"`
	SkipBranchName bool        `json:"skip_branch_name,omitempty"`
	SkipRepoName   bool        `json:"skip_repo_name,omitempty"`
	Credentials    Credentials `json:"credentials,omitempty"`
}

Repo is the configuration for the repository

func (*Repo) String

func (r *Repo) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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