repo

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Created

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

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 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, timestamp int64) (*Repo, error)

Create handles create commands

func Replay

func Replay(events []ddd.Event) *Repo

Replay recreates the repo from a series of events

func (*Repo) Destroy

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

Destroy handles destroy commands

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) UUID

func (r *Repo) UUID() string

UUID gets the repo's unique id

func (*Repo) Update

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

Update handles update commands

func (*Repo) Version

func (r *Repo) Version() int

Version gets all the

type Repository

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

Repository is the repository for dealing with repo storage

func NewRepository

func NewRepository(coll string, store storage.Storage) *Repository

NewRepository creates a repository with the given storage

func (*Repository) All

func (r *Repository) All() ([]*Repo, error)

All gets all repos, excluding deleted items

func (*Repository) Load

func (r *Repository) Load(uuid string) (*Repo, error)

Load reads out the repo for the uuid given

func (*Repository) Save

func (r *Repository) Save(repo *Repo) error

Save persists the new events for the repo given

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, 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) Charts

func (s Service) Charts(ctx context.Context, req *pb.ReadRepo) (*pb.ChartsRead, error)

Charts 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) Read

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

Read reads out a repo

func (Service) Update

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

Update edits an already existing repo

type Updated

type Updated struct {
	Timestamp int64
	Name      string
	Endpoint  string
}

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