apiserver

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRepositoryAuth

type CreateRepositoryAuth struct {
	Method   domain.RepositoryAuthMethod
	Username string
	Password string
	KeyID    string
}

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

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

type Service

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

func NewService

func NewService(
	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,
	pubKey *ssh.PublicKeys,
) *Service

func (*Service) CancelBuild

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

func (*Service) CreateApplication

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

func (*Service) CreateRepository

func (s *Service) CreateRepository(ctx context.Context, name, url string, auth optional.Of[CreateRepositoryAuth]) (*domain.Repository, error)

func (*Service) CreateUserKey

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

func (*Service) DeleteApplication

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

func (*Service) DeleteEnvironmentVariable added in v0.7.3

func (s *Service) DeleteEnvironmentVariable(ctx context.Context, applicationID string, key string) error

func (*Service) DeleteRepository

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

func (*Service) DeleteUserKey

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

func (*Service) GenerateKeyPair

func (s *Service) GenerateKeyPair(ctx context.Context) (keyID string, publicKey string, err error)

func (*Service) GetApplication

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

func (*Service) GetApplications

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

func (*Service) GetArtifact

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

func (*Service) GetAvailableDomains

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

func (*Service) GetAvailablePorts

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

func (*Service) GetBuild

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

func (*Service) GetBuildLog

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

func (*Service) GetBuildLogStream

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

func (*Service) GetBuilds

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

func (*Service) GetEnvironmentVariables

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

func (*Service) GetMe

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

func (*Service) GetOutput

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

func (*Service) GetOutputStream

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

func (*Service) GetRepositories

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

func (*Service) GetRepository

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

func (*Service) GetSystemPublicKey

func (s *Service) GetSystemPublicKey(_ context.Context) string

func (*Service) GetUserKeys

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

func (*Service) GetUsers

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

func (*Service) RefreshRepository

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

func (*Service) RetryCommitBuild

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

func (*Service) SetEnvironmentVariable

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

func (*Service) StartApplication

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

func (*Service) StopApplication

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

func (*Service) UpdateApplication

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

func (*Service) UpdateRepository

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

type UpdateRepositoryArgs

type UpdateRepositoryArgs struct {
	Name     optional.Of[string]
	URL      optional.Of[string]
	Auth     optional.Of[optional.Of[CreateRepositoryAuth]]
	OwnerIDs optional.Of[[]string]
}

Jump to

Keyboard shortcuts

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