types

package
v0.0.0-...-ce11450 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ConsulAddr = "consul-addr"
View Source
const ConsulTLSSkipVerify = "consul-tls-skip-verify"
View Source
const ListenPort = "listen-port"
View Source
const NomadAddr = "nomad-addr"
View Source
const NomadTLSSkipVerify = "nomad-tls-skip-verify"
View Source
const VaultAddr = "vault-addr"
View Source
const VaultTLSSkipVerify = "vault-tls-skip-verify"

Variables

This section is empty.

Functions

This section is empty.

Types

type AppRoleConfig

type AppRoleConfig struct {
	RoleID   string `hcl:"role_id"`
	SecretID string `hcl:"secret_id"`
	Path     string
}

type AuthConfig

type AuthConfig struct {
	Enabled        bool
	Type           string
	CredentialsDir string `hcl:"credentials_dir"`
}

type ConsulConfig

type ConsulConfig struct {
	Address  string
	ACLToken string `hcl:"acl_token"`
	TLS      TLSConfig
}

type Jobs

type Jobs interface {
	Register(*api.Job, *api.WriteOptions) (*api.JobRegisterResponse, *api.WriteMeta, error)
	Info(jobID string, q *api.QueryOptions) (*api.Job, *api.QueryMeta, error)
	List(q *api.QueryOptions) ([]*api.JobListStub, *api.QueryMeta, error)
	Deregister(jobID string, purge bool, q *api.WriteOptions) (string, *api.WriteMeta, error)
	Allocations(jobID string, allAllocs bool, q *api.QueryOptions) ([]*api.AllocationListStub, *api.QueryMeta, error)
}

type NomadConfig

type NomadConfig struct {
	Address    string
	ACLToken   string `hcl:"acl_token"`
	TLS        TLSConfig
	Region     string
	Namespace  string
	Driver     string
	Datacenter string
	Scheduling SchedulingDefaults
}

func NewNomadConfig

func NewNomadConfig() *NomadConfig

func (*NomadConfig) MakeClient

func (nc *NomadConfig) MakeClient() (Jobs, error)

type ProviderConfig

type ProviderConfig struct {
	LogLevel       string `hcl:"log_level"`
	ListenPort     int    `hcl:"listen_port"`
	HealthEnabled  bool   `hcl:"health_enabled"`
	Auth           AuthConfig
	DNSServers     bool `hcl:"dns_servers"`
	Nomad          NomadConfig
	Consul         ConsulConfig
	Vault          VaultConfig
	FunctionPrefix string
	ReadTimeout    time.Duration `hcl:"read_timeout"`
	WriteTimeout   time.Duration `hcl:"write_timeout"`
}

func NewProviderConfig

func NewProviderConfig() *ProviderConfig

func (*ProviderConfig) Default

func (pc *ProviderConfig) Default() *ProviderConfig

func (*ProviderConfig) LoadCommandLine

func (pc *ProviderConfig) LoadCommandLine(args map[string]interface{}) *ProviderConfig

func (*ProviderConfig) LoadFile

func (pc *ProviderConfig) LoadFile(configFile string) (*ProviderConfig, error)

type SchedulingDefaults

type SchedulingDefaults struct {
	JobType         string `hcl:"job_type"`
	JobPrefix       string `hcl:"job_prefix"`
	Count           int
	Memory          int
	CPU             int
	RestartAttempts int    `hcl:"restart_attempts"`
	RestartMode     string `hcl:"restart_mode"`
	RestartDelay    string `hcl:"restart_delay"`
	Priority        int
	DiskSize        int
	NetworkingMode  string `hcl:"network_mode"`
}

type SecretConfig

type SecretConfig struct {
	KeyPrefix  string `hcl:"key_prefix"`
	KVVersion  int    `hcl:"kv_version"`
	PolicyName string `hcl:"policy_name"`
}

type TLSConfig

type TLSConfig struct {
	Insecure bool
	CAFile   string `hcl:"ca_file"`
	CertFile string `hcl:"cert_file"`
	KeyFile  string `hcl:"key_file"`
}

type VaultConfig

type VaultConfig struct {
	Client  *api.Client
	Address string
	TLS     TLSConfig
	AppRole AppRoleConfig
	Secrets SecretConfig
}

func NewVaultConfig

func NewVaultConfig() *VaultConfig

func (*VaultConfig) DoRequest

func (vc *VaultConfig) DoRequest(method string, path string, body interface{}) (*http.Response, error)

func (*VaultConfig) Login

func (vc *VaultConfig) Login() (*api.Secret, error)

func (*VaultConfig) MakeClient

func (vc *VaultConfig) MakeClient() (*api.Client, error)

Jump to

Keyboard shortcuts

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