config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arguments

type Arguments struct {
	ConfigFile string
}

func ParseArguments

func ParseArguments() Arguments

type Github

type Github struct {
	URL      string       `json:"url"`
	Accounts []WebAccount `json:"accounts"`
}

func (Github) Options

func (g Github) Options() *netapi.Options

type Gitlab

type Gitlab struct {
	URL      string       `json:"url"`
	Token    string       `json:"token"`
	Accounts []WebAccount `json:"accounts"`
}

func (Gitlab) Options

func (g Gitlab) Options() *netapi.Options

type Loader

type Loader interface {
	Load() (*Options, error)
}

func NewLoader

func NewLoader(filepath string) Loader

type Options

type Options struct {
	System []User `json:"system"`
	Github Github `json:"github"`
	Gitlab Gitlab `json:"gitlab"`
}

func (Options) GithubUsers

func (o Options) GithubUsers() map[string]string

GithubUsers returns a map from local system user to github username (for those that have one defined).

func (Options) GitlabUsers

func (o Options) GitlabUsers() map[string]string

GitlabUsers returns a map from local system user to gitlab username (for those that have one defined).

func (Options) SystemUsers

func (o Options) SystemUsers() map[string]string

SystemUsers returns a map from local system username to path of associated authorized keys file.

type User

type User struct {
	User               string `json:"user"`
	AuthorizedKeysFile string `json:"authorized_keys_file"`
}

type WebAccount

type WebAccount struct {
	Username   string `json:"username"`
	SystemUser string `json:"system_user"`
}

Directories

Path Synopsis
Package configtest contains autogenerated mocks.
Package configtest contains autogenerated mocks.

Jump to

Keyboard shortcuts

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