repo

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package repo handles configuration of VCS repositories.

Index

Constants

View Source
const PurgerLockID int64 = 179366396344335598

PurgerLockID is a unique ID guaranteeing only one purger on a cluster is running at any time.

Variables

This section is empty.

Functions

func NewService

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

Types

type Callback added in v0.1.4

type Callback func(event cloud.VCSEvent)

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 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 Options

type Purger added in v0.0.53

type Purger struct {
	DB purgerDB

	logr.Logger
	pubsub.Subscriber
	Service
}

Purge purges webhooks that are no longer in use.

func (*Purger) Start added in v0.0.53

func (p *Purger) Start(ctx context.Context) error

Start starts the purger daemon. Should be invoked in a go routine.

type RepoService

type RepoService = Service

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

	// Subscribe to incoming VCS events
	Subscribe(cb Callback)
	// contains filtered or unexported methods
}

Service manages VCS repositories

type Subscriber added in v0.1.4

type Subscriber interface {
	Subscribe(cb Callback)
}

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