mock

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2021 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package mock implements mocked services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOrganization

func NewOrganization(name, email string) *otf.Organization

func NewOrganizationList

func NewOrganizationList(name, email string, opts tfe.OrganizationListOptions) *otf.OrganizationList

func NewWorkspace

func NewWorkspace(name, id, org string) *otf.Workspace

func NewWorkspaceList

func NewWorkspaceList(name, id, org string, opts otf.WorkspaceListOptions) *otf.WorkspaceList

Types

type ConfigurationVersionService

type ConfigurationVersionService struct {
	CreateFn    func(workspaceID string, opts *tfe.ConfigurationVersionCreateOptions) (*otf.ConfigurationVersion, error)
	GetFn       func(id string) (*otf.ConfigurationVersion, error)
	GetLatestFn func(workspaceID string) (*otf.ConfigurationVersion, error)
	ListFn      func(workspaceID string, opts tfe.ConfigurationVersionListOptions) (*otf.ConfigurationVersionList, error)
	UploadFn    func(id string, payload []byte) error
	DownloadFn  func(id string) ([]byte, error)
}

func (ConfigurationVersionService) Create

func (ConfigurationVersionService) Download

func (s ConfigurationVersionService) Download(id string) ([]byte, error)

func (ConfigurationVersionService) Get

func (ConfigurationVersionService) GetLatest

func (s ConfigurationVersionService) GetLatest(workspaceID string) (*otf.ConfigurationVersion, error)

func (ConfigurationVersionService) List

func (ConfigurationVersionService) Upload

func (s ConfigurationVersionService) Upload(id string, payload []byte) error

type EventService

type EventService struct {
	PublishFn   func(event otf.Event)
	SubscribeFn func(id string) otf.Subscription
}

func (EventService) Publish

func (s EventService) Publish(event otf.Event)

func (EventService) Subscribe

func (s EventService) Subscribe(id string) otf.Subscription

type OrganizationService

type OrganizationService struct {
	CreateOrganizationFn func(opts *tfe.OrganizationCreateOptions) (*otf.Organization, error)
	UpdateOrganizationFn func(name string, opts *tfe.OrganizationUpdateOptions) (*otf.Organization, error)
	GetOrganizationFn    func(name string) (*otf.Organization, error)
	ListOrganizationFn   func(opts tfe.OrganizationListOptions) (*otf.OrganizationList, error)
	DeleteOrganizationFn func(name string) error
	GetEntitlementsFn    func(name string) (*otf.Entitlements, error)
}

func (OrganizationService) Create

func (OrganizationService) Delete

func (s OrganizationService) Delete(name string) error

func (OrganizationService) Get

func (OrganizationService) GetEntitlements

func (s OrganizationService) GetEntitlements(name string) (*otf.Entitlements, error)

func (OrganizationService) List

func (OrganizationService) Update

type PlanService

type PlanService struct {
	GetFn         func(id string) (*otf.Plan, error)
	GetPlanJSONFn func(id string) ([]byte, error)
}

func (PlanService) Get

func (s PlanService) Get(id string) (*otf.Plan, error)

func (PlanService) GetPlanJSON

func (s PlanService) GetPlanJSON(id string) ([]byte, error)

type Queue

type Queue struct {
	Runs []*otf.Run
}

func (*Queue) Add

func (q *Queue) Add(run *otf.Run) error

func (*Queue) Remove

func (q *Queue) Remove(run *otf.Run) error

type RunService

type RunService struct {
	CreateFn       func(opts *tfe.RunCreateOptions) (*otf.Run, error)
	GetFn          func(id string) (*otf.Run, error)
	ListFn         func(opts otf.RunListOptions) (*otf.RunList, error)
	ApplyFn        func(id string, opts *tfe.RunApplyOptions) error
	DiscardFn      func(id string, opts *tfe.RunDiscardOptions) error
	CancelFn       func(id string, opts *tfe.RunCancelOptions) error
	ForceCancelFn  func(id string, opts *tfe.RunForceCancelOptions) error
	GetPlanLogsFn  func(id string, opts otf.GetChunkOptions) ([]byte, error)
	GetApplyLogsFn func(id string, opts otf.GetChunkOptions) ([]byte, error)
	EnqueuePlanFn  func(id string) error
	UpdateStatusFn func(id string, status tfe.RunStatus) (*otf.Run, error)
	UploadLogsFn   func(id string, logs []byte, opts otf.PutChunkOptions) error
	StartFn        func(id string, opts otf.JobStartOptions) (otf.Job, error)
	FinishFn       func(id string, opts otf.JobFinishOptions) (otf.Job, error)
	GetPlanJSONFn  func(id string) ([]byte, error)
	GetPlanFileFn  func(id string) ([]byte, error)
	UploadPlanFn   func(id string, plan []byte, json bool) error
}

func (RunService) Apply

func (s RunService) Apply(id string, opts *tfe.RunApplyOptions) error

func (RunService) Cancel

func (s RunService) Cancel(id string, opts *tfe.RunCancelOptions) error

func (RunService) Create

func (s RunService) Create(opts *tfe.RunCreateOptions) (*otf.Run, error)

func (RunService) Discard

func (s RunService) Discard(id string, opts *tfe.RunDiscardOptions) error

func (RunService) EnqueuePlan

func (s RunService) EnqueuePlan(id string) error

func (RunService) Finish

func (s RunService) Finish(id string, opts otf.JobFinishOptions) (otf.Job, error)

func (RunService) ForceCancel

func (s RunService) ForceCancel(id string, opts *tfe.RunForceCancelOptions) error

func (RunService) Get

func (s RunService) Get(id string) (*otf.Run, error)

func (RunService) GetApplyLogs

func (s RunService) GetApplyLogs(id string, opts otf.GetChunkOptions) ([]byte, error)

func (RunService) GetPlanFile

func (s RunService) GetPlanFile(id string) ([]byte, error)

func (RunService) GetPlanJSON

func (s RunService) GetPlanJSON(id string) ([]byte, error)

func (RunService) GetPlanLogs

func (s RunService) GetPlanLogs(id string, opts otf.GetChunkOptions) ([]byte, error)

func (RunService) List

func (s RunService) List(opts otf.RunListOptions) (*otf.RunList, error)

func (RunService) Start

func (s RunService) Start(id string, opts otf.JobStartOptions) (otf.Job, error)

func (RunService) UpdateStatus

func (s RunService) UpdateStatus(id string, status tfe.RunStatus) (*otf.Run, error)

func (RunService) UploadLogs

func (s RunService) UploadLogs(id string, logs []byte, opts otf.PutChunkOptions) error

func (RunService) UploadPlan

func (s RunService) UploadPlan(id string, plan []byte, json bool) error

type StateVersionService

type StateVersionService struct {
	CreateFn   func(workspaceID string, opts tfe.StateVersionCreateOptions) (*otf.StateVersion, error)
	CurrentFn  func(workspaceID string) (*otf.StateVersion, error)
	GetFn      func(id string) (*otf.StateVersion, error)
	DownloadFn func(id string) ([]byte, error)
	ListFn     func(opts tfe.StateVersionListOptions) (*otf.StateVersionList, error)
}

func (StateVersionService) Create

func (StateVersionService) Current

func (s StateVersionService) Current(workspaceID string) (*otf.StateVersion, error)

func (StateVersionService) Download

func (s StateVersionService) Download(id string) ([]byte, error)

func (StateVersionService) Get

func (StateVersionService) List

type WorkspaceService

type WorkspaceService struct {
	CreateWorkspaceFn func(org string, opts *tfe.WorkspaceCreateOptions) (*otf.Workspace, error)
	UpdateWorkspaceFn func(spec otf.WorkspaceSpecifier, opts *tfe.WorkspaceUpdateOptions) (*otf.Workspace, error)
	GetWorkspaceFn    func(spec otf.WorkspaceSpecifier) (*otf.Workspace, error)
	ListWorkspaceFn   func(opts otf.WorkspaceListOptions) (*otf.WorkspaceList, error)
	DeleteWorkspaceFn func(spec otf.WorkspaceSpecifier) error
	LockWorkspaceFn   func(id string, opts tfe.WorkspaceLockOptions) (*otf.Workspace, error)
	UnlockWorkspaceFn func(id string) (*otf.Workspace, error)
}

func (WorkspaceService) Create

func (WorkspaceService) Delete

func (WorkspaceService) Get

func (WorkspaceService) List

func (WorkspaceService) Lock

func (WorkspaceService) Unlock

func (s WorkspaceService) Unlock(id string) (*otf.Workspace, error)

func (WorkspaceService) Update

Jump to

Keyboard shortcuts

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