mock

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: MPL-2.0 Imports: 9 Imported by: 125

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ACLManagementToken added in v0.7.0

func ACLManagementToken() *structs.ACLToken

func ACLPolicy added in v0.7.0

func ACLPolicy() *structs.ACLPolicy

func ACLToken added in v0.7.0

func ACLToken() *structs.ACLToken

func AgentPolicy added in v0.7.0

func AgentPolicy(policy string) string

AgentPolicy is a helper for generating the hcl for a given agent policy.

func Alloc

func Alloc() *structs.Allocation

func BatchAlloc added in v0.8.0

func BatchAlloc() *structs.Allocation

func BatchConnectAlloc added in v0.10.4

func BatchConnectAlloc() *structs.Allocation

BatchConnectAlloc is useful for testing task runner things.

func BatchConnectJob added in v0.10.4

func BatchConnectJob() *structs.Job

func BatchJob added in v0.8.0

func BatchJob() *structs.Job

func ConnectAlloc added in v0.10.0

func ConnectAlloc() *structs.Allocation

ConnectJob adds a Connect proxy sidecar group service to mock.Alloc.

func ConnectJob added in v0.10.0

func ConnectJob() *structs.Job

ConnectJob adds a Connect proxy sidecar group service to mock.Job.

Note this does *not* include the Job.Register mutation that inserts the associated Sidecar Task (nor the hook that configures envoy as the default).

func CreatePolicy added in v0.7.0

func CreatePolicy(t testing.T, state StateStore, index uint64, name, rule string)

CreatePolicy creates a policy with the given name and rule.

func CreatePolicyAndToken added in v0.7.0

func CreatePolicyAndToken(t testing.T, state StateStore, index uint64, name, rule string) *structs.ACLToken

CreatePolicyAndToken creates a policy and then returns a token configured for just that policy. CreatePolicyAndToken uses the given index and index+1.

func CreateToken added in v0.7.0

func CreateToken(t testing.T, state StateStore, index uint64, policies []string) *structs.ACLToken

CreateToken creates a local, client token for the given policies

func Deployment added in v0.6.0

func Deployment() *structs.Deployment

func Eval

func Eval() *structs.Evaluation

func HCL added in v0.8.2

func HCL() string

func HostVolumePolicy added in v0.10.0

func HostVolumePolicy(vol string, policy string, capabilities []string) string

HostVolumePolicy is a helper for generating the policy hcl for a given host-volume. Either policy or capabilities may be nil but not both.

func Job

func Job() *structs.Job

func JobSummary added in v0.4.1

func JobSummary(jobID string) *structs.JobSummary

func MaxParallelJob added in v0.10.0

func MaxParallelJob() *structs.Job

func NamespacePolicy added in v0.7.0

func NamespacePolicy(namespace string, policy string, capabilities []string) string

NamespacePolicy is a helper for generating the policy hcl for a given namespace. Either policy or capabilities may be nil but not both.

func Node

func Node() *structs.Node

func NodePolicy added in v0.7.0

func NodePolicy(policy string) string

NodePolicy is a helper for generating the hcl for a given node policy.

func NvidiaNode added in v0.9.0

func NvidiaNode() *structs.Node

NvidiaNode returns a node with two instances of an Nvidia GPU

func PeriodicJob added in v0.3.0

func PeriodicJob() *structs.Job

func Plan

func Plan() *structs.Plan

func PlanResult

func PlanResult() *structs.PlanResult

func QuotaPolicy added in v0.7.0

func QuotaPolicy(policy string) string

QuotaPolicy is a helper for generating the hcl for a given quota policy.

func SITokenAccessor added in v0.10.4

func SITokenAccessor() *structs.SITokenAccessor

func SystemAlloc added in v0.8.0

func SystemAlloc() *structs.Allocation

func SystemJob added in v0.2.0

func SystemJob() *structs.Job

func VaultAccessor added in v0.5.0

func VaultAccessor() *structs.VaultAccessor

Types

type StateStore added in v0.7.0

type StateStore interface {
	UpsertACLPolicies(index uint64, policies []*structs.ACLPolicy) error
	UpsertACLTokens(index uint64, tokens []*structs.ACLToken) error
}

StateStore defines the methods required from state.StateStore but avoids a circular dependency.

Jump to

Keyboard shortcuts

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