domain

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingProvider   = errors.New("missing provider")
	ErrInvalidRepository = errors.New("invalid repository identity")
	ErrInvalidWebhook    = errors.New("invalid webhook specification")
)

Functions

This section is empty.

Types

type EventType

type EventType string

EventType represents a VCS event the system can subscribe to.

const (
	EventPush        EventType = "push"
	EventPullRequest EventType = "pull_request"
)

type GitRepository

type GitRepository struct {
	Provider   Provider
	Repository RepositoryID
	Webhooks   []WebhookSpec
}

GitRepository is the domain model representing a registered source repository.

func (GitRepository) Validate

func (g GitRepository) Validate() error

Validate enforces domain invariants.

type Provider

type Provider string

Provider identifies a supported VCS provider.

const (
	ProviderGitHub Provider = "github"
)

type RepositoryID

type RepositoryID struct {
	Owner string
	Name  string
}

RepositoryID is the external identity of a repository.

func (RepositoryID) IsValid

func (r RepositoryID) IsValid() bool

IsValid validates the repository identity.

type Result

type Result struct {
	State  State
	Reason string
}

Result represents the outcome of attempting to realize a GitRepository registration.

func Failure

func Failure(reason string) Result

Failure returns a failed realization result.

func Pending

func Pending(reason string) Result

Pending returns a pending realization result.

func Success

func Success() Result

Success returns a successful realization result.

type State

type State string

State represents the lifecycle state of a GitRepository registration.

const (
	// StatePending means the repository has been declared
	// but has not yet been realized.
	StatePending State = "Pending"

	// StateReady means the repository and all required webhooks
	// are realized and match desired intent.
	StateReady State = "Ready"

	// StateError means realization failed and requires attention.
	StateError State = "Error"
)

func (State) IsTerminal

func (s State) IsTerminal() bool

IsTerminal indicates whether the state is terminal.

type WebhookSpec

type WebhookSpec struct {
	Events []EventType
}

WebhookSpec declares which events the repository should emit.

func (WebhookSpec) IsValid

func (w WebhookSpec) IsValid() bool

IsValid validates the webhook specification.

Jump to

Keyboard shortcuts

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