repo

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Replay

func Replay(events []ddd.Event) ddd.Aggregate

Replay recreates the repo from a series of events

Types

type Created

type Created struct {
	Timestamp int64
	UUID      string
	Name      string
	Endpoint  string
	Type      Type
}

Created is the event for when a new repo is created

func (Created) EventType

func (e Created) EventType() string

EventType marks this as an event

type Destroyed

type Destroyed struct {
	Timestamp int64
}

Destroyed is the event for when a repo is destroyed

func (Destroyed) EventType

func (e Destroyed) EventType() string

EventType marks this as an event

type ReadRepository added in v0.4.0

type ReadRepository struct {
	// contains filtered or unexported fields
}

ReadRepository is the repository for dealing with repo reads

func NewReadRepository added in v0.4.0

func NewReadRepository(s storage.Storage) *ReadRepository

NewReadRepository creates a repository with the given storage

func (*ReadRepository) All added in v0.4.0

func (rr *ReadRepository) All() ([]*Repo, error)

All gets all repos

func (*ReadRepository) Load added in v0.4.0

func (rr *ReadRepository) Load(uuid string) (*Repo, error)

Load gets one repo

type Repo

type Repo struct {
	// contains filtered or unexported fields
}

Repo represents a repository, for now helm only

func Create

func Create(uuid, name, endpoint string, t Type, timestamp int64) (*Repo, error)

Create handles create commands

func (*Repo) Destroy

func (r *Repo) Destroy(timestamp int64) error

Destroy handles destroy commands

func (*Repo) Destroyed added in v0.4.0

func (r *Repo) Destroyed() bool

Destroyed determines if this repo has been destroyed

func (*Repo) Endpoint

func (r *Repo) Endpoint() string

Endpoint gets the repo's endpoint

func (*Repo) Events

func (r *Repo) Events() []ddd.Event

Events gets all events from this repo

func (*Repo) Name

func (r *Repo) Name() string

Name gets the repo's name

func (*Repo) Type added in v0.4.0

func (r *Repo) Type() Type

Type gets the repo type (helm, git, etc.)

func (*Repo) UUID

func (r *Repo) UUID() string

UUID gets the repo's unique id

func (*Repo) Update

func (r *Repo) Update(name, endpoint string, t Type, timestamp int64) error

Update handles update commands

func (*Repo) Version

func (r *Repo) Version() int

Version gets all the

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is the implementation for twirp to use

func NewService

func NewService(a auth.Agent, g git.Agent, h helm.Agent, s storage.Storage) *Service

NewService creates the service

func (Service) All

func (s Service) All(ctx context.Context, req *pb.ReadRepos) (*pb.ReposRead, error)

All gets all repos currently configured and their status

func (Service) Chart added in v0.4.0

func (s Service) Chart(ctx context.Context, req *pb.ReadChart) (*pb.ChartRead, error)

Chart gets all the charts for this repository

func (Service) Create

func (s Service) Create(ctx context.Context, cmd *pb.CreateRepo) (*pb.RepoCreated, error)

Create adds a repo to the list of configurations

func (Service) Destroy

func (s Service) Destroy(ctx context.Context, cmd *pb.DestroyRepo) (*pb.RepoDestroyed, error)

Destroy removes a repo from the list of configurations

func (Service) File added in v0.4.0

func (s Service) File(ctx context.Context, req *pb.ReadFile) (*pb.FileRead, error)

File gets the contents of a file from the git repo

func (Service) Find added in v0.4.0

func (s Service) Find(ctx context.Context, req *pb.FindRepo) (*pb.RepoFound, error)

Find finds the repo uuid by name

func (Service) Read

func (s Service) Read(ctx context.Context, req *pb.ReadRepo) (*pb.RepoRead, error)

Read reads out a repo

func (Service) Ready added in v0.3.2

func (s Service) Ready() error

Ready implements the ReadyService method so this service can be part of a health check routine

func (Service) Update

func (s Service) Update(ctx context.Context, cmd *pb.UpdateRepo) (*pb.RepoUpdated, error)

Update edits an already existing repo

type Type added in v0.4.0

type Type int64

Type represents the kind of repo

const (
	// HELM repo
	HELM Type = 0

	// GIT repo
	GIT Type = 1
)

type Updated

type Updated struct {
	Timestamp int64
	Name      string
	Endpoint  string
	Type      Type
}

Updated is the event for when a repo is updated

func (Updated) EventType

func (e Updated) EventType() string

EventType marks this as an event

Jump to

Keyboard shortcuts

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