config

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: MIT Imports: 7 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 LoaderMock

type LoaderMock struct {
	LoadMock mLoaderMockLoad
	// contains filtered or unexported fields
}

LoaderMock implements Loader

func NewLoaderMock

func NewLoaderMock(t minimock.Tester) *LoaderMock

NewLoaderMock returns a mock for Loader

func (*LoaderMock) Load

func (mmLoad *LoaderMock) Load() (op1 *Options, err error)

Load implements Loader

func (*LoaderMock) LoadAfterCounter

func (mmLoad *LoaderMock) LoadAfterCounter() uint64

LoadAfterCounter returns a count of finished LoaderMock.Load invocations

func (*LoaderMock) LoadBeforeCounter

func (mmLoad *LoaderMock) LoadBeforeCounter() uint64

LoadBeforeCounter returns a count of LoaderMock.Load invocations

func (*LoaderMock) MinimockFinish

func (m *LoaderMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*LoaderMock) MinimockLoadDone

func (m *LoaderMock) MinimockLoadDone() bool

MinimockLoadDone returns true if the count of the Load invocations corresponds the number of defined expectations

func (*LoaderMock) MinimockLoadInspect

func (m *LoaderMock) MinimockLoadInspect()

MinimockLoadInspect logs each unmet expectation

func (*LoaderMock) MinimockWait

func (m *LoaderMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

type LoaderMockLoadExpectation

type LoaderMockLoadExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

LoaderMockLoadExpectation specifies expectation struct of the Loader.Load

type LoaderMockLoadResults

type LoaderMockLoadResults struct {
	// contains filtered or unexported fields
}

LoaderMockLoadResults contains results of the Loader.Load

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"`
}

Jump to

Keyboard shortcuts

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