capsule

package
v0.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job interface {
	Run(ctx context.Context) error
}

type Queue

type Queue[T interface{}] struct {
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue[T interface{}]() *Queue[T]

func (*Queue[T]) AddJob

func (q *Queue[T]) AddJob(t T, deadline time.Time)

func (*Queue[T]) Next

func (q *Queue[T]) Next(ctx context.Context, now func() time.Time) (t T, err error)

type QueueHeap

type QueueHeap[T interface{}] []QueueItem[T]

func (QueueHeap[T]) Len

func (qs QueueHeap[T]) Len() int

func (QueueHeap[T]) Less

func (qs QueueHeap[T]) Less(i, j int) bool

func (QueueHeap[T]) Peek

func (qs QueueHeap[T]) Peek() QueueItem[T]

func (*QueueHeap[T]) Pop

func (qs *QueueHeap[T]) Pop() any

func (*QueueHeap[T]) Push

func (qs *QueueHeap[T]) Push(t any)

func (QueueHeap[T]) Swap

func (qs QueueHeap[T]) Swap(i, j int)

type QueueItem

type QueueItem[T interface{}] struct {
	// contains filtered or unexported fields
}

type Service

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

func NewService

func NewService(cr repository.Capsule, sr repository.Secret, cg cluster.Gateway, as *auth.Service, logger *zap.Logger) *Service

func (*Service) AbortRollout

func (s *Service) AbortRollout(ctx context.Context, capsuleID uuid.UUID, rolloutID uint64) error

func (*Service) CreateBuild

func (s *Service) CreateBuild(ctx context.Context, capsuleID uuid.UUID, buildID string, image string, origin *capsule.Origin, labels map[string]string) error

func (*Service) CreateCapsule

func (s *Service) CreateCapsule(ctx context.Context, name string, is []*capsule.Update) (uuid.UUID, error)

func (*Service) CreateEvent

func (s *Service) CreateEvent(ctx context.Context, capsuleID uuid.UUID, rolloutID uint64, message string, ed *capsule.EventData) error

func (*Service) DeleteBuild

func (s *Service) DeleteBuild(ctx context.Context, capsuleID uuid.UUID, buildID string) error

func (*Service) DeleteCapsule

func (s *Service) DeleteCapsule(ctx context.Context, capsuleID uuid.UUID) error

func (*Service) Deploy

func (s *Service) Deploy(ctx context.Context, capsuleID uuid.UUID, cs []*capsule.Change) error

func (*Service) GetCapsule

func (s *Service) GetCapsule(ctx context.Context, capsuleID uuid.UUID) (*capsule.Capsule, error)

func (*Service) GetCapsuleByName

func (s *Service) GetCapsuleByName(ctx context.Context, name string) (*capsule.Capsule, error)

func (*Service) GetRollout

func (s *Service) GetRollout(ctx context.Context, capsuleID uuid.UUID, rolloutID uint64) (*capsule.Rollout, error)

func (*Service) ListBuilds

func (s *Service) ListBuilds(ctx context.Context, capsuleID uuid.UUID, pagination *model.Pagination) (iterator.Iterator[*capsule.Build], uint64, error)

func (*Service) ListCapsules

func (s *Service) ListCapsules(ctx context.Context, pagination *model.Pagination) (iterator.Iterator[*capsule.Capsule], int64, error)

func (*Service) ListEvents

func (s *Service) ListEvents(ctx context.Context, capsuleID uuid.UUID, rolloutID uint64, pagination *model.Pagination) (iterator.Iterator[*capsule.Event], uint64, error)

func (*Service) ListInstances

func (s *Service) ListInstances(ctx context.Context, capsuleID uuid.UUID, pagination *model.Pagination) (iterator.Iterator[*capsule.Instance], uint64, error)

func (*Service) ListRollouts

func (s *Service) ListRollouts(ctx context.Context, capsuleID uuid.UUID, pagination *model.Pagination) (iterator.Iterator[*capsule.Rollout], uint64, error)

func (*Service) Logs

func (s *Service) Logs(ctx context.Context, capsuleID uuid.UUID, instanceID string, follow bool) (iterator.Iterator[*capsule.Log], error)

func (*Service) RestartInstance

func (s *Service) RestartInstance(ctx context.Context, capsuleID uuid.UUID, instanceID string) error

func (*Service) UpdateCapsule

func (s *Service) UpdateCapsule(ctx context.Context, capsuleID uuid.UUID, us []*capsule.Update) error

Jump to

Keyboard shortcuts

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