Documentation
¶
Overview ¶
Package app implements services, co-ordinating between the layers of the project.
Index ¶
- type Application
- func (a *Application) ApplyRun(ctx context.Context, runID string, opts otf.RunApplyOptions) error
- func (a *Application) CancelRun(ctx context.Context, runID string, opts otf.RunCancelOptions) error
- func (a *Application) CloneConfigurationVersion(ctx context.Context, cvID string, opts otf.ConfigurationVersionCreateOptions) (*otf.ConfigurationVersion, error)
- func (a *Application) ConnectWorkspace(ctx context.Context, workspaceID string, opts otf.ConnectWorkspaceOptions) error
- func (a *Application) CreateAgentToken(ctx context.Context, opts otf.CreateAgentTokenOptions) (*otf.AgentToken, error)
- func (a *Application) CreateConfigurationVersion(ctx context.Context, workspaceID string, ...) (*otf.ConfigurationVersion, error)
- func (a *Application) CreateModule(ctx context.Context, opts otf.CreateModuleOptions) (*otf.Module, error)
- func (a *Application) CreateModuleVersion(ctx context.Context, opts otf.CreateModuleVersionOptions) (*otf.ModuleVersion, error)
- func (a *Application) CreateOrganization(ctx context.Context, opts otf.OrganizationCreateOptions) (*otf.Organization, error)
- func (a *Application) CreateRun(ctx context.Context, workspaceID string, opts otf.RunCreateOptions) (*otf.Run, error)
- func (a *Application) CreateSession(ctx context.Context, userID, address string) (*otf.Session, error)
- func (a *Application) CreateTeam(ctx context.Context, opts otf.CreateTeamOptions) (*otf.Team, error)
- func (a *Application) CreateToken(ctx context.Context, userID string, opts *otf.TokenCreateOptions) (*otf.Token, error)
- func (a *Application) CreateUser(ctx context.Context, username string) (*otf.User, error)
- func (a *Application) CreateVCSProvider(ctx context.Context, opts otf.VCSProviderCreateOptions) (*otf.VCSProvider, error)
- func (a *Application) CreateWorkspace(ctx context.Context, opts otf.CreateWorkspaceOptions) (*otf.Workspace, error)
- func (a *Application) DB() otf.DB
- func (a *Application) DeleteAgentToken(ctx context.Context, id string) (*otf.AgentToken, error)
- func (a *Application) DeleteModule(ctx context.Context, id string) (*otf.Module, error)
- func (a *Application) DeleteOrganization(ctx context.Context, name string) error
- func (a *Application) DeleteRun(ctx context.Context, runID string) error
- func (a *Application) DeleteSession(ctx context.Context, token string) error
- func (a *Application) DeleteToken(ctx context.Context, userID string, tokenID string) error
- func (a *Application) DeleteVCSProvider(ctx context.Context, id string) (*otf.VCSProvider, error)
- func (a *Application) DeleteWorkspace(ctx context.Context, workspaceID string) (*otf.Workspace, error)
- func (a *Application) DiscardRun(ctx context.Context, runID string, opts otf.RunDiscardOptions) error
- func (a *Application) DisconnectWorkspace(ctx context.Context, workspaceID string) (*otf.Workspace, error)
- func (a *Application) DownloadConfig(ctx context.Context, cvID string) ([]byte, error)
- func (a *Application) DownloadModuleVersion(ctx context.Context, opts otf.DownloadModuleOptions) ([]byte, error)
- func (a *Application) EnqueuePlan(ctx context.Context, runID string) (*otf.Run, error)
- func (a *Application) EnsureCreatedOrganization(ctx context.Context, opts otf.OrganizationCreateOptions) (*otf.Organization, error)
- func (a *Application) EnsureCreatedTeam(ctx context.Context, opts otf.CreateTeamOptions) (*otf.Team, error)
- func (a *Application) EnsureCreatedUser(ctx context.Context, username string) (*otf.User, error)
- func (a *Application) FinishPhase(ctx context.Context, runID string, phase otf.PhaseType, ...) (*otf.Run, error)
- func (a *Application) ForceCancelRun(ctx context.Context, runID string, opts otf.RunForceCancelOptions) error
- func (a *Application) GetAgentToken(ctx context.Context, token string) (*otf.AgentToken, error)
- func (a *Application) GetChunk(ctx context.Context, opts otf.GetChunkOptions) (otf.Chunk, error)
- func (a *Application) GetConfigurationVersion(ctx context.Context, cvID string) (*otf.ConfigurationVersion, error)
- func (a *Application) GetEntitlements(ctx context.Context, organization string) (*otf.Entitlements, error)
- func (a *Application) GetLatestConfigurationVersion(ctx context.Context, workspaceID string) (*otf.ConfigurationVersion, error)
- func (a *Application) GetLockFile(ctx context.Context, runID string) ([]byte, error)
- func (a *Application) GetModule(ctx context.Context, opts otf.GetModuleOptions) (*otf.Module, error)
- func (a *Application) GetModuleByID(ctx context.Context, id string) (*otf.Module, error)
- func (a *Application) GetModuleByWebhookID(ctx context.Context, id uuid.UUID) (*otf.Module, error)
- func (a *Application) GetOrganization(ctx context.Context, name string) (*otf.Organization, error)
- func (a *Application) GetPlanFile(ctx context.Context, runID string, format otf.PlanFormat) ([]byte, error)
- func (a *Application) GetRun(ctx context.Context, runID string) (*otf.Run, error)
- func (a *Application) GetSessionByToken(ctx context.Context, token string) (*otf.Session, error)
- func (a *Application) GetTeam(ctx context.Context, teamID string) (*otf.Team, error)
- func (a *Application) GetUser(ctx context.Context, spec otf.UserSpec) (*otf.User, error)
- func (a *Application) GetVCSClient(ctx context.Context, providerID string) (cloud.Client, error)
- func (a *Application) GetVCSProvider(ctx context.Context, id string) (*otf.VCSProvider, error)
- func (a *Application) GetWorkspace(ctx context.Context, workspaceID string) (*otf.Workspace, error)
- func (a *Application) GetWorkspaceByName(ctx context.Context, organization, workspace string) (*otf.Workspace, error)
- func (a *Application) Hostname() string
- func (a *Application) ListAgentTokens(ctx context.Context, organization string) ([]*otf.AgentToken, error)
- func (a *Application) ListConfigurationVersions(ctx context.Context, workspaceID string, ...) (*otf.ConfigurationVersionList, error)
- func (a *Application) ListModules(ctx context.Context, opts otf.ListModulesOptions) ([]*otf.Module, error)
- func (a *Application) ListOrganizations(ctx context.Context, opts otf.OrganizationListOptions) (*otf.OrganizationList, error)
- func (a *Application) ListRuns(ctx context.Context, opts otf.RunListOptions) (*otf.RunList, error)
- func (a *Application) ListSessions(ctx context.Context, userID string) ([]*otf.Session, error)
- func (a *Application) ListTeamMembers(ctx context.Context, teamID string) ([]*otf.User, error)
- func (a *Application) ListTeams(ctx context.Context, organization string) ([]*otf.Team, error)
- func (a *Application) ListTokens(ctx context.Context, userID string) ([]*otf.Token, error)
- func (a *Application) ListUsers(ctx context.Context, opts otf.UserListOptions) ([]*otf.User, error)
- func (a *Application) ListVCSProviders(ctx context.Context, organization string) ([]*otf.VCSProvider, error)
- func (a *Application) ListWorkspacePermissions(ctx context.Context, workspaceID string) ([]*otf.WorkspacePermission, error)
- func (a *Application) ListWorkspaces(ctx context.Context, opts otf.WorkspaceListOptions) (*otf.WorkspaceList, error)
- func (a *Application) ListWorkspacesByWebhookID(ctx context.Context, id uuid.UUID) ([]*otf.Workspace, error)
- func (a *Application) LockWorkspace(ctx context.Context, workspaceID string, opts otf.WorkspaceLockOptions) (*otf.Workspace, error)
- func (a *Application) PublishModule(ctx context.Context, opts otf.PublishModuleOptions) (*otf.Module, error)
- func (a *Application) PutChunk(ctx context.Context, chunk otf.Chunk) error
- func (a *Application) SetCurrentRun(ctx context.Context, workspaceID, runID string) (*otf.Workspace, error)
- func (a *Application) SetHostname(hostname string, listen *net.TCPAddr) error
- func (a *Application) SetWorkspacePermission(ctx context.Context, workspaceID, team string, role rbac.Role) error
- func (a *Application) StartPhase(ctx context.Context, runID string, phase otf.PhaseType, ...) (*otf.Run, error)
- func (a *Application) SyncUserMemberships(ctx context.Context, user *otf.User, orgs []string, teams []*otf.Team) (*otf.User, error)
- func (a *Application) Tail(ctx context.Context, opts otf.GetChunkOptions) (<-chan otf.Chunk, error)
- func (a *Application) Tx(ctx context.Context, tx func(a otf.Application) error) error
- func (a *Application) UnlockWorkspace(ctx context.Context, workspaceID string, opts otf.WorkspaceUnlockOptions) (*otf.Workspace, error)
- func (a *Application) UnsetWorkspacePermission(ctx context.Context, workspaceID, team string) error
- func (a *Application) UpdateModuleStatus(ctx context.Context, opts otf.UpdateModuleStatusOptions) (*otf.Module, error)
- func (a *Application) UpdateOrganization(ctx context.Context, name string, opts *otf.OrganizationUpdateOptions) (*otf.Organization, error)
- func (a *Application) UpdateTeam(ctx context.Context, teamID string, opts otf.UpdateTeamOptions) (*otf.Team, error)
- func (a *Application) UpdateWorkspace(ctx context.Context, workspaceID string, opts otf.UpdateWorkspaceOptions) (*otf.Workspace, error)
- func (a *Application) UpdateWorkspaceRepo(ctx context.Context, workspaceID string, repo otf.WorkspaceRepo) (*otf.Workspace, error)
- func (a *Application) UploadConfig(ctx context.Context, cvID string, config []byte) error
- func (a *Application) UploadLockFile(ctx context.Context, runID string, plan []byte) error
- func (a *Application) UploadModuleVersion(ctx context.Context, opts otf.UploadModuleVersionOptions) (*otf.ModuleVersion, error)
- func (a *Application) UploadPlanFile(ctx context.Context, runID string, plan []byte, format otf.PlanFormat) error
- func (a *Application) Watch(ctx context.Context, opts otf.WatchOptions) (<-chan otf.Event, error)
- func (a *Application) WatchLogs(ctx context.Context, opts otf.WatchLogsOptions) (<-chan otf.Chunk, error)
- func (a *Application) WithLock(ctx context.Context, id int64, cb func(otf.Application) error) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶ added in v0.0.12
type Application struct {
*otf.RunFactory
*otf.VCSProviderFactory
otf.WorkspaceConnector
otf.HookService
*otf.RunStarter
*module.Publisher
*otf.ModuleVersionUploader
otf.ModuleDeleter
cloud.Service
otf.PubSubService
logr.Logger
otf.Authorizer
otf.StateVersionService
otf.VariableApp
// contains filtered or unexported fields
}
Application encompasses services for interacting between components of the otf server
func NewApplication ¶ added in v0.0.12
func NewApplication(ctx context.Context, opts Options) (*Application, error)
NewApplication constructs an application, initialising various services and daemons.
func (*Application) ApplyRun ¶ added in v0.0.12
func (a *Application) ApplyRun(ctx context.Context, runID string, opts otf.RunApplyOptions) error
ApplyRun enqueues an apply for the run.
func (*Application) CancelRun ¶ added in v0.0.12
func (a *Application) CancelRun(ctx context.Context, runID string, opts otf.RunCancelOptions) error
CancelRun a run. If a run is in progress then a cancelation signal will be sent out.
func (*Application) CloneConfigurationVersion ¶ added in v0.0.16
func (a *Application) CloneConfigurationVersion(ctx context.Context, cvID string, opts otf.ConfigurationVersionCreateOptions) (*otf.ConfigurationVersion, error)
func (*Application) ConnectWorkspace ¶ added in v0.0.19
func (a *Application) ConnectWorkspace(ctx context.Context, workspaceID string, opts otf.ConnectWorkspaceOptions) error
func (*Application) CreateAgentToken ¶ added in v0.0.12
func (a *Application) CreateAgentToken(ctx context.Context, opts otf.CreateAgentTokenOptions) (*otf.AgentToken, error)
func (*Application) CreateConfigurationVersion ¶ added in v0.0.12
func (a *Application) CreateConfigurationVersion(ctx context.Context, workspaceID string, opts otf.ConfigurationVersionCreateOptions) (*otf.ConfigurationVersion, error)
func (*Application) CreateModule ¶ added in v0.0.19
func (a *Application) CreateModule(ctx context.Context, opts otf.CreateModuleOptions) (*otf.Module, error)
func (*Application) CreateModuleVersion ¶ added in v0.0.19
func (a *Application) CreateModuleVersion(ctx context.Context, opts otf.CreateModuleVersionOptions) (*otf.ModuleVersion, error)
func (*Application) CreateOrganization ¶ added in v0.0.12
func (a *Application) CreateOrganization(ctx context.Context, opts otf.OrganizationCreateOptions) (*otf.Organization, error)
CreateOrganization creates an organization. Needs admin permission.
func (*Application) CreateRun ¶ added in v0.0.12
func (a *Application) CreateRun(ctx context.Context, workspaceID string, opts otf.RunCreateOptions) (*otf.Run, error)
CreateRun creates a run. Caller needs to have created a config version first.
func (*Application) CreateSession ¶ added in v0.0.12
func (a *Application) CreateSession(ctx context.Context, userID, address string) (*otf.Session, error)
CreateSession creates and persists a user session.
func (*Application) CreateTeam ¶ added in v0.0.12
func (a *Application) CreateTeam(ctx context.Context, opts otf.CreateTeamOptions) (*otf.Team, error)
func (*Application) CreateToken ¶ added in v0.0.12
func (a *Application) CreateToken(ctx context.Context, userID string, opts *otf.TokenCreateOptions) (*otf.Token, error)
CreateToken creates a user token. Only users can create a user token, and they can only create a token for themselves.
func (*Application) CreateUser ¶ added in v0.0.12
func (*Application) CreateVCSProvider ¶ added in v0.0.16
func (a *Application) CreateVCSProvider(ctx context.Context, opts otf.VCSProviderCreateOptions) (*otf.VCSProvider, error)
func (*Application) CreateWorkspace ¶ added in v0.0.12
func (a *Application) CreateWorkspace(ctx context.Context, opts otf.CreateWorkspaceOptions) (*otf.Workspace, error)
func (*Application) DB ¶ added in v0.0.19
func (a *Application) DB() otf.DB
func (*Application) DeleteAgentToken ¶ added in v0.0.12
func (a *Application) DeleteAgentToken(ctx context.Context, id string) (*otf.AgentToken, error)
func (*Application) DeleteModule ¶ added in v0.0.19
func (*Application) DeleteOrganization ¶ added in v0.0.12
func (a *Application) DeleteOrganization(ctx context.Context, name string) error
func (*Application) DeleteRun ¶ added in v0.0.12
func (a *Application) DeleteRun(ctx context.Context, runID string) error
DeleteRun deletes a run.
func (*Application) DeleteSession ¶ added in v0.0.12
func (a *Application) DeleteSession(ctx context.Context, token string) error
func (*Application) DeleteToken ¶ added in v0.0.12
func (*Application) DeleteVCSProvider ¶ added in v0.0.16
func (a *Application) DeleteVCSProvider(ctx context.Context, id string) (*otf.VCSProvider, error)
func (*Application) DeleteWorkspace ¶ added in v0.0.12
func (*Application) DiscardRun ¶ added in v0.0.12
func (a *Application) DiscardRun(ctx context.Context, runID string, opts otf.RunDiscardOptions) error
DiscardRun the run.
func (*Application) DisconnectWorkspace ¶ added in v0.0.19
func (*Application) DownloadConfig ¶ added in v0.0.12
func (*Application) DownloadModuleVersion ¶ added in v0.0.19
func (a *Application) DownloadModuleVersion(ctx context.Context, opts otf.DownloadModuleOptions) ([]byte, error)
DownloadModuleVersion should be accessed via signed URL
func (*Application) EnqueuePlan ¶ added in v0.0.12
EnqueuePlan enqueues a plan for the run.
NOTE: this is an internal action, invoked by the scheduler only.
func (*Application) EnsureCreatedOrganization ¶ added in v0.0.12
func (a *Application) EnsureCreatedOrganization(ctx context.Context, opts otf.OrganizationCreateOptions) (*otf.Organization, error)
EnsureCreatedOrganization idempotently creates an organization. Needs admin permission.
TODO: merge this into CreatedOrganization and add an option to toggle idempotency
func (*Application) EnsureCreatedTeam ¶ added in v0.0.12
func (a *Application) EnsureCreatedTeam(ctx context.Context, opts otf.CreateTeamOptions) (*otf.Team, error)
EnsureCreatedTeam retrieves the team or creates the team if it doesn't exist.
func (*Application) EnsureCreatedUser ¶ added in v0.0.12
EnsureCreatedUser retrieves the user or creates the user if they don't exist.
func (*Application) FinishPhase ¶ added in v0.0.12
func (a *Application) FinishPhase(ctx context.Context, runID string, phase otf.PhaseType, opts otf.PhaseFinishOptions) (*otf.Run, error)
FinishPhase finishes a phase. Creates a report of changes before updating the status of the run.
func (*Application) ForceCancelRun ¶ added in v0.0.12
func (a *Application) ForceCancelRun(ctx context.Context, runID string, opts otf.RunForceCancelOptions) error
ForceCancelRun forcefully cancels a run.
func (*Application) GetAgentToken ¶ added in v0.0.12
func (a *Application) GetAgentToken(ctx context.Context, token string) (*otf.AgentToken, error)
GetAgentToken retrieves an agent token using the given token.
func (*Application) GetChunk ¶ added in v0.0.12
func (a *Application) GetChunk(ctx context.Context, opts otf.GetChunkOptions) (otf.Chunk, error)
GetChunk reads a chunk of logs for a phase.
NOTE: unauthenticated - access granted only via signed URL
func (*Application) GetConfigurationVersion ¶ added in v0.0.12
func (a *Application) GetConfigurationVersion(ctx context.Context, cvID string) (*otf.ConfigurationVersion, error)
func (*Application) GetEntitlements ¶ added in v0.0.12
func (a *Application) GetEntitlements(ctx context.Context, organization string) (*otf.Entitlements, error)
func (*Application) GetLatestConfigurationVersion ¶ added in v0.0.12
func (a *Application) GetLatestConfigurationVersion(ctx context.Context, workspaceID string) (*otf.ConfigurationVersion, error)
func (*Application) GetLockFile ¶ added in v0.0.12
GetLockFile returns the lock file for the run.
func (*Application) GetModule ¶ added in v0.0.19
func (a *Application) GetModule(ctx context.Context, opts otf.GetModuleOptions) (*otf.Module, error)
func (*Application) GetModuleByID ¶ added in v0.0.19
func (*Application) GetModuleByWebhookID ¶ added in v0.0.19
func (*Application) GetOrganization ¶ added in v0.0.12
func (a *Application) GetOrganization(ctx context.Context, name string) (*otf.Organization, error)
GetOrganization retrieves an organization by name.
func (*Application) GetPlanFile ¶ added in v0.0.12
func (a *Application) GetPlanFile(ctx context.Context, runID string, format otf.PlanFormat) ([]byte, error)
GetPlanFile returns the plan file for the run.
func (*Application) GetSessionByToken ¶ added in v0.0.12
func (*Application) GetTeam ¶ added in v0.0.12
GetTeam retrieves a team in an organization. If the caller is an unprivileged user i.e. not an owner nor a site admin then they are only permitted to retrieve a team they are a member of.
func (*Application) GetVCSClient ¶ added in v0.0.23
func (*Application) GetVCSProvider ¶ added in v0.0.16
func (a *Application) GetVCSProvider(ctx context.Context, id string) (*otf.VCSProvider, error)
func (*Application) GetWorkspace ¶ added in v0.0.12
func (*Application) GetWorkspaceByName ¶ added in v0.0.21
func (*Application) Hostname ¶ added in v0.0.19
func (a *Application) Hostname() string
func (*Application) ListAgentTokens ¶ added in v0.0.12
func (a *Application) ListAgentTokens(ctx context.Context, organization string) ([]*otf.AgentToken, error)
func (*Application) ListConfigurationVersions ¶ added in v0.0.12
func (a *Application) ListConfigurationVersions(ctx context.Context, workspaceID string, opts otf.ConfigurationVersionListOptions) (*otf.ConfigurationVersionList, error)
func (*Application) ListModules ¶ added in v0.0.19
func (a *Application) ListModules(ctx context.Context, opts otf.ListModulesOptions) ([]*otf.Module, error)
func (*Application) ListOrganizations ¶ added in v0.0.12
func (a *Application) ListOrganizations(ctx context.Context, opts otf.OrganizationListOptions) (*otf.OrganizationList, error)
ListOrganizations lists organizations. If the caller is a normal user then only list their organizations; otherwise list all.
func (*Application) ListRuns ¶ added in v0.0.12
func (a *Application) ListRuns(ctx context.Context, opts otf.RunListOptions) (*otf.RunList, error)
ListRuns retrieves multiple run objs. Use opts to filter and paginate the list.
func (*Application) ListSessions ¶ added in v0.0.12
func (*Application) ListTeamMembers ¶ added in v0.0.19
ListTeamMembers lists users that are members of the given team. The caller needs either organization-wide authority to call this endpoint, or they need to be a member of the team.
func (*Application) ListTeams ¶ added in v0.0.12
ListTeams lists teams in the organization. If the caller is an unprivileged user i.e. not an owner nor a site admin then only their teams are listed.
func (*Application) ListTokens ¶ added in v0.0.12
func (*Application) ListUsers ¶ added in v0.0.12
func (a *Application) ListUsers(ctx context.Context, opts otf.UserListOptions) ([]*otf.User, error)
ListUsers lists users with various filters.
func (*Application) ListVCSProviders ¶ added in v0.0.16
func (a *Application) ListVCSProviders(ctx context.Context, organization string) ([]*otf.VCSProvider, error)
func (*Application) ListWorkspacePermissions ¶ added in v0.0.12
func (a *Application) ListWorkspacePermissions(ctx context.Context, workspaceID string) ([]*otf.WorkspacePermission, error)
func (*Application) ListWorkspaces ¶ added in v0.0.12
func (a *Application) ListWorkspaces(ctx context.Context, opts otf.WorkspaceListOptions) (*otf.WorkspaceList, error)
func (*Application) ListWorkspacesByWebhookID ¶ added in v0.0.19
func (*Application) LockWorkspace ¶ added in v0.0.12
func (a *Application) LockWorkspace(ctx context.Context, workspaceID string, opts otf.WorkspaceLockOptions) (*otf.Workspace, error)
func (*Application) PublishModule ¶ added in v0.0.19
func (a *Application) PublishModule(ctx context.Context, opts otf.PublishModuleOptions) (*otf.Module, error)
func (*Application) SetCurrentRun ¶ added in v0.0.12
func (a *Application) SetCurrentRun(ctx context.Context, workspaceID, runID string) (*otf.Workspace, error)
SetCurrentRun sets the current run for the workspace
func (*Application) SetHostname ¶ added in v0.0.19
func (a *Application) SetHostname(hostname string, listen *net.TCPAddr) error
func (*Application) SetWorkspacePermission ¶ added in v0.0.12
func (*Application) StartPhase ¶ added in v0.0.12
func (a *Application) StartPhase(ctx context.Context, runID string, phase otf.PhaseType, _ otf.PhaseStartOptions) (*otf.Run, error)
StartPhase starts a run phase.
func (*Application) SyncUserMemberships ¶ added in v0.0.12
func (*Application) Tail ¶ added in v0.0.12
func (a *Application) Tail(ctx context.Context, opts otf.GetChunkOptions) (<-chan otf.Chunk, error)
Tail logs for a phase. Offset specifies the number of bytes into the logs from which to start tailing.
func (*Application) Tx ¶ added in v0.0.12
func (a *Application) Tx(ctx context.Context, tx func(a otf.Application) error) error
Tx provides a callback in which all db interactions are wrapped within a transaction. Useful for ensuring multiple service calls succeed together.
func (*Application) UnlockWorkspace ¶ added in v0.0.12
func (a *Application) UnlockWorkspace(ctx context.Context, workspaceID string, opts otf.WorkspaceUnlockOptions) (*otf.Workspace, error)
func (*Application) UnsetWorkspacePermission ¶ added in v0.0.12
func (a *Application) UnsetWorkspacePermission(ctx context.Context, workspaceID, team string) error
func (*Application) UpdateModuleStatus ¶ added in v0.0.19
func (a *Application) UpdateModuleStatus(ctx context.Context, opts otf.UpdateModuleStatusOptions) (*otf.Module, error)
func (*Application) UpdateOrganization ¶ added in v0.0.12
func (a *Application) UpdateOrganization(ctx context.Context, name string, opts *otf.OrganizationUpdateOptions) (*otf.Organization, error)
func (*Application) UpdateTeam ¶ added in v0.0.12
func (a *Application) UpdateTeam(ctx context.Context, teamID string, opts otf.UpdateTeamOptions) (*otf.Team, error)
func (*Application) UpdateWorkspace ¶ added in v0.0.12
func (a *Application) UpdateWorkspace(ctx context.Context, workspaceID string, opts otf.UpdateWorkspaceOptions) (*otf.Workspace, error)
func (*Application) UpdateWorkspaceRepo ¶ added in v0.0.16
func (a *Application) UpdateWorkspaceRepo(ctx context.Context, workspaceID string, repo otf.WorkspaceRepo) (*otf.Workspace, error)
func (*Application) UploadConfig ¶ added in v0.0.12
UploadConfig saves a configuration tarball to the db
NOTE: unauthenticated - access granted only via signed URL
func (*Application) UploadLockFile ¶ added in v0.0.12
UploadLockFile persists the lock file for a run.
func (*Application) UploadModuleVersion ¶ added in v0.0.19
func (a *Application) UploadModuleVersion(ctx context.Context, opts otf.UploadModuleVersionOptions) (*otf.ModuleVersion, error)
func (*Application) UploadPlanFile ¶ added in v0.0.12
func (a *Application) UploadPlanFile(ctx context.Context, runID string, plan []byte, format otf.PlanFormat) error
UploadPlanFile persists a run's plan file. The plan format should be either be binary or json.
func (*Application) Watch ¶ added in v0.0.12
func (a *Application) Watch(ctx context.Context, opts otf.WatchOptions) (<-chan otf.Event, error)
Watch provides authenticated access to a stream of events.
NOTE: only events for workspaces and workspace related resources such as runs are watched.
func (*Application) WatchLogs ¶ added in v0.0.12
func (a *Application) WatchLogs(ctx context.Context, opts otf.WatchLogsOptions) (<-chan otf.Chunk, error)
WatchLogs provides a subscription to phase logs.
NOTE: unauthenticated. External access to this endpoint should only be made via signed URLs.
func (*Application) WithLock ¶ added in v0.0.12
func (a *Application) WithLock(ctx context.Context, id int64, cb func(otf.Application) error) error
WithLock provides a callback in which the application's database connection possesses a lock with the given ID, with the guarantee that that lock is exclusive, i.e. no other connection has a lock with the same ID. If a lock with the given ID is already present then this method will block until it is released.