connections

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

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

Types

type ConnectOptions

type ConnectOptions struct {
	ConnectionType // OTF resource type

	VCSProviderID string // vcs provider of repo
	ResourceID    string // ID of OTF resource
	RepoPath      string
}

type Connection

type Connection struct {
	VCSProviderID string
	Repo          string
}

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

type ConnectionService

type ConnectionService Service

type ConnectionType

type ConnectionType int

ConnectionType identifies the OTF resource type in a VCS connection.

const (
	WorkspaceConnection ConnectionType = iota
	ModuleConnection
)

type DisconnectOptions

type DisconnectOptions struct {
	ConnectionType // OTF resource type

	ResourceID string // ID of OTF resource
}

type Service

type Service interface {
	// Connect adds a connection between a VCS repo and an OTF resource. A
	// webhook is created if one doesn't exist already.
	Connect(ctx context.Context, opts ConnectOptions) (*Connection, error)

	// Disconnect removes a connection between a VCS repo and an OTF
	// resource. If there are no more connections then its
	// webhook is removed.
	Disconnect(ctx context.Context, opts DisconnectOptions) error
}

Service manages connections between OTF resources and VCS repos

type SynchroniseOptions

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

Jump to

Keyboard shortcuts

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