connections

package
v0.3.21 Latest Latest
Warning

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

Go to latest
Published: May 4, 2025 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package connections manages connections between VCS repositories and OTF resources, e.g. workspaces, modules.

templ: version: v0.3.865

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Steps added in v0.3.17

func Steps(current Step) templ.Component

Types

type ConnectOptions

type ConnectOptions struct {
	VCSProviderID resource.TfeID // vcs provider of repo
	ResourceID    resource.TfeID // ID of OTF resource to connect.
	RepoPath      string
}

type Connection

type Connection struct {
	ModuleID      *resource.TfeID `db:"module_id"`
	WorkspaceID   *resource.TfeID `db:"workspace_id"`
	Repo          string
	VCSProviderID resource.TfeID `db:"vcs_provider_id"`
}

Connection is a connection between a VCS repo and an OTF resource.

NOTE: order of fields must be same as that of its postgres table columns.

type DisconnectOptions

type DisconnectOptions struct {
	ResourceID resource.TfeID // ID of OTF resource to disconnect
}

type Options

type Options struct {
	logr.Logger
	*sql.DB

	VCSProviderService *vcsprovider.Service
	RepoHooksService   *repohooks.Service
}

type ReposTable added in v0.3.17

type ReposTable struct {
	Actions func(repo string) templ.Component
}

func (ReposTable) Header added in v0.3.17

func (t ReposTable) Header() templ.Component

func (ReposTable) Row added in v0.3.17

func (t ReposTable) Row(repo string) templ.Component

type Service

type Service struct {
	logr.Logger
	// contains filtered or unexported fields
}

func NewService

func NewService(ctx context.Context, opts Options) *Service

func (*Service) Connect

func (s *Service) Connect(ctx context.Context, opts ConnectOptions) (*Connection, error)

Connect an OTF resource to a VCS repo.

func (*Service) Disconnect

func (s *Service) Disconnect(ctx context.Context, opts DisconnectOptions) error

Disconnect resource from repo

type Step added in v0.3.17

type Step int
const (
	ConnectStep Step = iota
	SelectRepoStep
)

steps for connecting a workspace to repo

type SynchroniseOptions

type SynchroniseOptions struct {
	VCSProviderID resource.TfeID // vcs provider of repo
	RepoPath      string
}

Jump to

Keyboard shortcuts

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