dbfake

package
v2.31.9 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuilderOption added in v2.31.1

type BuilderOption func(*WorkspaceBuildBuilder)

BuilderOption is a functional option for customizing job timestamps on status methods.

func WithJobCompletedAt added in v2.31.1

func WithJobCompletedAt(t time.Time) BuilderOption

WithJobCompletedAt sets the CompletedAt timestamp for the provisioner job.

func WithJobCreatedAt added in v2.31.1

func WithJobCreatedAt(t time.Time) BuilderOption

WithJobCreatedAt sets the CreatedAt timestamp for the provisioner job.

func WithJobError added in v2.31.1

func WithJobError(msg string) BuilderOption

WithJobError sets the error message for the provisioner job.

func WithJobErrorCode added in v2.31.1

func WithJobErrorCode(code string) BuilderOption

WithJobErrorCode sets the error code for the provisioner job.

func WithJobStartedAt added in v2.31.1

func WithJobStartedAt(t time.Time) BuilderOption

WithJobStartedAt sets the StartedAt timestamp for the provisioner job.

func WithJobUpdatedAt added in v2.31.1

func WithJobUpdatedAt(t time.Time) BuilderOption

WithJobUpdatedAt sets the UpdatedAt timestamp for the provisioner job.

type JobCompleteBuilder added in v2.7.0

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

func JobComplete added in v2.7.0

func JobComplete(t testing.TB, db database.Store, jobID uuid.UUID) JobCompleteBuilder

func (JobCompleteBuilder) Do added in v2.7.0

func (JobCompleteBuilder) Pubsub added in v2.7.0

type JobCompleteResponse added in v2.7.0

type JobCompleteResponse struct {
	CompletedAt time.Time
}

type OrganizationBuilder added in v2.17.0

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

func Organization added in v2.17.0

func Organization(t *testing.T, db database.Store) OrganizationBuilder

func (OrganizationBuilder) Deleted added in v2.20.3

func (b OrganizationBuilder) Deleted(deleted bool) OrganizationBuilder

func (OrganizationBuilder) Do added in v2.17.0

func (OrganizationBuilder) EveryoneAllowance added in v2.17.0

func (b OrganizationBuilder) EveryoneAllowance(allowance int) OrganizationBuilder

func (OrganizationBuilder) Group added in v2.17.0

func (OrganizationBuilder) Members added in v2.17.0

func (OrganizationBuilder) Seed added in v2.17.0

type OrganizationResponse added in v2.17.0

type OrganizationResponse struct {
	Org           database.Organization
	AllUsersGroup database.Group
	Members       []database.OrganizationMember
	Groups        []database.Group
}

type ProvisionerJobResourcesBuilder added in v2.5.0

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

func ProvisionerJobResources added in v2.4.0

func ProvisionerJobResources(
	t testing.TB, db database.Store, jobID uuid.UUID, transition database.WorkspaceTransition, resources ...*sdkproto.Resource,
) ProvisionerJobResourcesBuilder

ProvisionerJobResources inserts a series of resources into a provisioner job.

func (ProvisionerJobResourcesBuilder) Do added in v2.5.0

type TemplateVersionBuilder added in v2.5.0

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

func TemplateVersion added in v2.5.0

func TemplateVersion(t testing.TB, db database.Store) TemplateVersionBuilder

TemplateVersion generates a template version and optionally a parent template if no template ID is set on the seed.

func (TemplateVersionBuilder) Do added in v2.5.0

func (TemplateVersionBuilder) FileID added in v2.9.0

func (TemplateVersionBuilder) Params added in v2.5.0

func (TemplateVersionBuilder) Preset added in v2.22.0

func (TemplateVersionBuilder) Pubsub added in v2.5.0

func (TemplateVersionBuilder) Resources added in v2.5.0

func (TemplateVersionBuilder) Seed added in v2.5.0

func (TemplateVersionBuilder) SkipCreateTemplate added in v2.22.0

func (t TemplateVersionBuilder) SkipCreateTemplate() TemplateVersionBuilder

type TemplateVersionResponse added in v2.5.0

type TemplateVersionResponse struct {
	Template        database.Template
	TemplateVersion database.TemplateVersion
}

type WorkspaceBuildBuilder added in v2.5.0

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

WorkspaceBuildBuilder generates workspace builds and associated resources.

func WorkspaceBuild added in v2.4.0

WorkspaceBuild generates a workspace build for the provided workspace. Pass a database.Workspace{} with a nil ID to also generate a new workspace. Omitting the template ID on a workspace will also generate a new template with a template version.

func (WorkspaceBuildBuilder) Canceled added in v2.28.0

Canceled sets the job to canceled status.

func (WorkspaceBuildBuilder) Do added in v2.5.0

Do generates all the resources associated with a workspace build. Template and TemplateVersion will be optionally populated if no TemplateID is set on the provided workspace. Workspace will be optionally populated if no ID is set on the provided workspace.

func (WorkspaceBuildBuilder) Failed added in v2.31.1

Failed sets the provisioner job to a failed state. Use WithJobError and WithJobErrorCode options to set the error message and code. If no error message is provided, "failed" is used as the default.

func (WorkspaceBuildBuilder) Params added in v2.5.0

func (WorkspaceBuildBuilder) Pending added in v2.28.0

Pending sets the job to pending status.

func (WorkspaceBuildBuilder) ProvisionerState added in v2.31.1

func (b WorkspaceBuildBuilder) ProvisionerState(state []byte) WorkspaceBuildBuilder

ProvisionerState sets the provisioner state for the workspace build. This is stored separately from the seed because ProvisionerState is not part of the WorkspaceBuild view struct.

func (WorkspaceBuildBuilder) Pubsub added in v2.5.0

func (WorkspaceBuildBuilder) Resource added in v2.5.0

func (WorkspaceBuildBuilder) Seed added in v2.5.0

func (WorkspaceBuildBuilder) Starting added in v2.7.0

Starting sets the job to running status.

func (WorkspaceBuildBuilder) Succeeded added in v2.31.1

Succeeded sets the job to succeeded status. This is the default status.

func (WorkspaceBuildBuilder) WithAgent added in v2.5.0

func (b WorkspaceBuildBuilder) WithAgent(mutations ...func([]*sdkproto.Agent) []*sdkproto.Agent) WorkspaceBuildBuilder

func (WorkspaceBuildBuilder) WithTask added in v2.28.0

type WorkspaceResponse added in v2.5.0

type WorkspaceResponse struct {
	Workspace  database.WorkspaceTable
	Build      database.WorkspaceBuild
	Agents     []database.WorkspaceAgent
	AgentToken string
	TemplateVersionResponse
	Task database.Task
}

Jump to

Keyboard shortcuts

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