server

package
v0.0.0-...-9f60fe2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func API

func API(cfg Config, rti runtime.Initializer, execRouter *router.ExecRouter, sshKeysService *router.SSHKeysRouter)

func BuildsCreate

func BuildsCreate(rti runtime.Initializer) http.HandlerFunc

BuildsCreate expects a request body containing both the build context and the json params for the build.

	eg. curl -X POST \
			 -H 'Authorization: Bearer <token>' \
 		 	 -H 'Content-Type: multipart/form-data' \
 		 	 -F context=@context.zip \
 		 	 -F 'params={"builder": "docker"}'
			 https://<api-host>/builds

func BuildsGet

func BuildsGet(rti runtime.Initializer) http.HandlerFunc

BuildsGet returns the details of a build. If the query param `logs` is set to true, the logs of the build will be returned as well.

func GetVolumeStore

func GetVolumeStore() volume.Store

func InitStore

func InitStore(volumeStore volume.Store)

Types

type BuildMetaDataV1

type BuildMetaDataV1 struct {
	Version int16  `json:"version"`
	Error   string `json:"error"`
}

BuildMetaDataV1 versions the metadata for a build stored in the DB.

type BuilderService

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

func (*BuilderService) Build

func (b *BuilderService) Build(ctx context.Context, projectID string, params *types.BuildsCreateParams) (string, error)

func (*BuilderService) GetImageURI

func (b *BuilderService) GetImageURI(ctx context.Context, buildID string) (string, error)

func (*BuilderService) GetLogs

func (b *BuilderService) GetLogs(ctx context.Context, buildID string) ([]types.LogEntry, error)

type Config

type Config struct {
	APIPort string    `json:"port" env:"UNWEAVE_API_PORT"`
	DB      db.Config `json:"db"`
}

type Service

type Service struct {
	Builder *BuilderService
	// contains filtered or unexported fields
}

func NewCtxService

func NewCtxService(rti runtime.Initializer, accountID, callerID string) *Service

func (*Service) InitializeBuilder

func (s *Service) InitializeBuilder(ctx context.Context, builder string) (builder.Builder, error)

Jump to

Keyboard shortcuts

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