usecase

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: MIT Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServerService

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

func NewAPIServerService

func NewAPIServerService(
	artifactRepo domain.ArtifactRepository,
	appRepo domain.ApplicationRepository,
	buildRepo domain.BuildRepository,
	envRepo domain.EnvironmentRepository,
	gitRepo domain.GitRepositoryRepository,
	userRepo domain.UserRepository,
	storage domain.Storage,
	mariaDBManager domain.MariaDBManager,
	mongoDBManager domain.MongoDBManager,
	containerLogger domain.ContainerLogger,
	controller domain.ControllerServiceClient,
) *APIServerService

func (*APIServerService) CancelBuild

func (s *APIServerService) CancelBuild(ctx context.Context, buildID string) error

func (*APIServerService) CreateApplication

func (s *APIServerService) CreateApplication(ctx context.Context, app *domain.Application) (*domain.Application, error)

func (*APIServerService) CreateRepository

func (s *APIServerService) CreateRepository(ctx context.Context, repo *domain.Repository) error

func (*APIServerService) CreateUserKey

func (s *APIServerService) CreateUserKey(ctx context.Context, publicKey string) (*domain.UserKey, error)

func (*APIServerService) DeleteApplication

func (s *APIServerService) DeleteApplication(ctx context.Context, id string) error

func (*APIServerService) DeleteRepository

func (s *APIServerService) DeleteRepository(ctx context.Context, id string) error

func (*APIServerService) DeleteUserKey

func (s *APIServerService) DeleteUserKey(ctx context.Context, keyID string) error

func (*APIServerService) GetApplication

func (s *APIServerService) GetApplication(ctx context.Context, id string) (*domain.Application, error)

func (*APIServerService) GetApplications

func (s *APIServerService) GetApplications(ctx context.Context, all bool) ([]*domain.Application, error)

func (*APIServerService) GetArtifact

func (s *APIServerService) GetArtifact(_ context.Context, artifactID string) (filename string, r io.ReadCloser, err error)

func (*APIServerService) GetAvailableDomains

func (s *APIServerService) GetAvailableDomains(ctx context.Context) (domain.AvailableDomainSlice, error)

func (*APIServerService) GetAvailablePorts added in v0.3.0

func (s *APIServerService) GetAvailablePorts(ctx context.Context) (domain.AvailablePortSlice, error)

func (*APIServerService) GetBuild

func (s *APIServerService) GetBuild(ctx context.Context, buildID string) (*domain.Build, error)

func (*APIServerService) GetBuildLog

func (s *APIServerService) GetBuildLog(ctx context.Context, buildID string) ([]byte, error)

func (*APIServerService) GetBuildLogStream

func (s *APIServerService) GetBuildLogStream(ctx context.Context, buildID string) (<-chan *pb.BuildLog, error)

func (*APIServerService) GetBuilds

func (s *APIServerService) GetBuilds(ctx context.Context, applicationID string) ([]*domain.Build, error)

func (*APIServerService) GetEnvironmentVariables

func (s *APIServerService) GetEnvironmentVariables(ctx context.Context, applicationID string) ([]*domain.Environment, error)

func (*APIServerService) GetMe added in v0.4.1

func (s *APIServerService) GetMe(ctx context.Context) *domain.User

func (*APIServerService) GetOutput

func (s *APIServerService) GetOutput(ctx context.Context, id string, before time.Time) ([]*domain.ContainerLog, error)

func (*APIServerService) GetOutputStream

func (s *APIServerService) GetOutputStream(ctx context.Context, id string, after time.Time, send func(l *domain.ContainerLog) error) error

func (*APIServerService) GetRepositories

func (s *APIServerService) GetRepositories(ctx context.Context, scope GetRepoScope) ([]*domain.Repository, error)

func (*APIServerService) GetRepository

func (s *APIServerService) GetRepository(ctx context.Context, id string) (*domain.Repository, error)

func (*APIServerService) GetUserKeys

func (s *APIServerService) GetUserKeys(ctx context.Context) ([]*domain.UserKey, error)

func (*APIServerService) GetUsers added in v0.4.6

func (s *APIServerService) GetUsers(ctx context.Context) ([]*domain.User, error)

func (*APIServerService) RefreshRepository added in v0.2.0

func (s *APIServerService) RefreshRepository(ctx context.Context, id string) error

func (*APIServerService) RetryCommitBuild

func (s *APIServerService) RetryCommitBuild(ctx context.Context, applicationID string, commit string) error

func (*APIServerService) SetEnvironmentVariable

func (s *APIServerService) SetEnvironmentVariable(ctx context.Context, applicationID string, key string, value string) error

func (*APIServerService) StartApplication

func (s *APIServerService) StartApplication(ctx context.Context, id string) error

func (*APIServerService) StopApplication

func (s *APIServerService) StopApplication(ctx context.Context, id string) error

func (*APIServerService) UpdateApplication

func (s *APIServerService) UpdateApplication(ctx context.Context, id string, args *domain.UpdateApplicationArgs) error

func (*APIServerService) UpdateRepository

func (s *APIServerService) UpdateRepository(ctx context.Context, id string, args *domain.UpdateRepositoryArgs) error

type AppDeployHelper

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

type BuilderService

type BuilderService interface {
	Start(ctx context.Context) error
	Shutdown(ctx context.Context) error
}

type CleanerService

type CleanerService interface {
	Start(ctx context.Context) error
	Shutdown(ctx context.Context) error
}

func NewCleanerService

func NewCleanerService(
	artifactRepo domain.ArtifactRepository,
	appRepo domain.ApplicationRepository,
	buildRepo domain.BuildRepository,
	image builder.ImageConfig,
	storage domain.Storage,
) (CleanerService, error)

type ContainerStateMutator

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

func NewContainerStateMutator

func NewContainerStateMutator(
	appRepo domain.ApplicationRepository,
	backend domain.Backend,
) *ContainerStateMutator

type ContinuousDeploymentService

type ContinuousDeploymentService interface {
	Run()
	RegisterBuilds()
	StartBuilds()
	SyncDeployments()
	Stop(ctx context.Context) error
}

type ErrorType

type ErrorType int
const (
	ErrorTypeBadRequest ErrorType = iota
	ErrorTypeNotFound
	ErrorTypeAlreadyExists
	ErrorTypeForbidden
)

func DecomposeError

func DecomposeError(err error) (underlying error, typ ErrorType, ok bool)

type GetRepoScope added in v0.5.0

type GetRepoScope int
const (
	GetRepoScopeMine GetRepoScope = iota
	GetRepoScopePublic
	GetRepoScopeAll
)

type LogStreamService

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

func NewLogStreamService

func NewLogStreamService() *LogStreamService

func (*LogStreamService) AppendBuildLog

func (l *LogStreamService) AppendBuildLog(id string, logPortion []byte)

func (*LogStreamService) CloseBuildLog

func (l *LogStreamService) CloseBuildLog(id string)

func (*LogStreamService) StartBuildLog

func (l *LogStreamService) StartBuildLog(id string)

func (*LogStreamService) SubscribeBuildLog

func (l *LogStreamService) SubscribeBuildLog(id string, sub chan<- []byte) (ok bool, unsubscribe func())

type RepositoryFetcherService

type RepositoryFetcherService interface {
	Run()
	Fetch(repositoryIDs []string)
	Stop(ctx context.Context) error
}

type SSHServer

type SSHServer interface {
	Start() error
	Close() error
	// contains filtered or unexported methods
}

func NewSSHServer

func NewSSHServer(
	config domain.SSHConfig,
	sshKey *ssh2.PublicKeys,
	backend domain.Backend,
	appRepo domain.ApplicationRepository,
	userRepo domain.UserRepository,
) SSHServer

type SiteReloadTarget

type SiteReloadTarget struct {
	ApplicationID string
	BuildID       string
}

type StaticSiteServerService

type StaticSiteServerService interface {
	Start(ctx context.Context) error
	Shutdown(ctx context.Context) error
}

Directories

Path Synopsis
Package mock_usecase is a generated GoMock package.
Package mock_usecase is a generated GoMock package.

Jump to

Keyboard shortcuts

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