repo

package
v0.8.11 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 22 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 Agent added in v0.6.0

type Agent interface {
	CheckIndex(name, endpoint, token string) bool
	GetChart(name, version, endpoint, token string) ([]byte, error)
	GetChartFromOCIV2(name, version, endpoint, username, password string) ([]byte, error)
}

Agent is the interface we use to talk to helm packages

type Created

type Created struct {
	Timestamp int64
	UUID      string
	Name      string
	Endpoint  string
	Token     string
	Username  string
	Password  string
	Type      Type
	HelmOCI   bool
}

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 DefaultAgent added in v0.6.0

type DefaultAgent struct{}

DefaultAgent is the default implementation of the Agent interface

func (DefaultAgent) CheckIndex added in v0.6.0

func (a DefaultAgent) CheckIndex(name, endpoint, token string) bool

CheckIndex checks the index.yaml file at the repo's endpoint

func (DefaultAgent) GetChart added in v0.6.0

func (a DefaultAgent) GetChart(name, version, endpoint, token string) ([]byte, error)

GetChart downloads a single chart from a particular chart repo

func (DefaultAgent) GetChartFromOCIV2 added in v0.8.2

func (a DefaultAgent) GetChartFromOCIV2(name, version, endpoint, username, password string) ([]byte, error)

GetChartFromOCIV2 gets a chart from a V2 compliant OCI registry

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, token, username, password string, t Type, helmOCI bool, 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) HelmOCI added in v0.8.2

func (r *Repo) HelmOCI() bool

HelmOCI returns whether this is an OCI repo

func (*Repo) Name

func (r *Repo) Name() string

Name gets the repo's name

func (*Repo) Password added in v0.8.2

func (r *Repo) Password() string

Password gets the repo's password

func (*Repo) Token added in v0.5.0

func (r *Repo) Token() string

Token gets the repo's access token

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, token, username, password string, t Type, helmOCI bool, timestamp int64) error

Update handles update commands

func (*Repo) Username added in v0.8.2

func (r *Repo) Username() string

Username gets the repo's username

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, r 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) 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) 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
	Token     string
	Username  string
	Password  string
	Type      Type
	HelmOCI   bool
}

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