apiserver

package
v1.4.12 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: MIT Imports: 23 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 GetAppScope added in v0.20.0

type GetAppScope struct {
	Scope        GetAppScopeType
	RepositoryID optional.Of[string]
}

type GetAppScopeType added in v0.20.0

type GetAppScopeType int
const (
	GetAppScopeMine GetAppScopeType = iota
	GetAppScopeAll
	GetAppScopeRepository
)

type GetRepoScope

type GetRepoScope int
const (
	GetRepoScopeMine GetRepoScope = iota
	GetRepoScopeCreatable
	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,
	commitRepo domain.RepositoryCommitRepository,
	userRepo domain.UserRepository,
	storage domain.Storage,
	mariaDBManager domain.MariaDBManager,
	mongoDBManager domain.MongoDBManager,
	metricsService domain.MetricsService,
	containerLogger domain.ContainerLogger,
	controller domain.ControllerServiceClient,
	image builder.ImageConfig,
	fallbackKey *ssh.PublicKeys,
) (*Service, error)

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, name 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) GetAllBuilds added in v0.13.0

func (s *Service) GetAllBuilds(ctx context.Context, page, limit int) ([]*domain.Build, error)

func (*Service) GetApplication

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

func (*Service) GetApplicationMetrics added in v0.15.0

func (s *Service) GetApplicationMetrics(ctx context.Context, name string, id string, before time.Time, limit time.Duration) ([]*domain.AppMetric, error)

func (*Service) GetApplications

func (s *Service) GetApplications(ctx context.Context, scope GetAppScope) ([]*TopAppInfo, error)

func (*Service) GetArtifact

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

func (*Service) GetAvailableMetrics added in v0.15.0

func (s *Service) GetAvailableMetrics(_ context.Context) []string

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, limit int) ([]*domain.ContainerLog, error)

func (*Service) GetOutputStream

func (s *Service) GetOutputStream(ctx context.Context, id string, begin 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) GetRepositoryCommits added in v1.3.0

func (s *Service) GetRepositoryCommits(ctx context.Context, hashes []string) ([]*domain.RepositoryCommit, error)

func (*Service) GetRepositoryRefs added in v0.13.0

func (s *Service) GetRepositoryRefs(ctx context.Context, id string) (map[string]string, error)

func (*Service) GetSystemInfo added in v0.10.1

func (s *Service) GetSystemInfo(ctx context.Context) (*domain.SystemInfo, error)

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 TopAppInfo added in v0.17.0

type TopAppInfo struct {
	App         *domain.Application
	LatestBuild *domain.Build
}

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