runtime

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	DisplayName string
	Pod         string
	Message     string
	Time        time.Time
}

Log is the struct of log.

type Repo

type Repo interface {
	Get(key string) (runtime.Object, error)
	Search(namespace, pattern string) []runtime.Object
	Delete(key string) error
	Logs(ctx context.Context, key string) (<-chan Log, error)
}

Repo is the interface of repository.

type Service

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

Service is the layer of use case, it encapsulates and implements all of the use cases of the system.

func NewService

func NewService(r Repo) *Service

NewService create a new service.

func (*Service) Delete

func (s *Service) Delete(key string) error

Delete delete the object by the key.

func (*Service) Get

func (s *Service) Get(key string) (runtime.Object, error)

Get get the object by the key, the format is "namespace/key", and if doesn't exist it return nil.

func (*Service) Logs

func (s *Service) Logs(ctx context.Context, key string) (<-chan Log, error)

Logs follow logs from the object until the context is done.

func (*Service) Search

func (s *Service) Search(namespace, pattern string) []runtime.Object

Search get objects which are matched with pattern.

type UseCase

type UseCase interface {
	Get(key string) (runtime.Object, error)
	Search(namespace, pattern string) []runtime.Object
	Delete(key string) error
	Logs(ctx context.Context, key string) (<-chan Log, error)
}

UseCase is the interface of use case.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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