server

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLogFileNotFound = errors.New("log file not found")
)

Functions

func GetBuildLogsDir added in v0.52.0

func GetBuildLogsDir(configDir string) string

func GetConfigDir added in v0.11.0

func GetConfigDir() (string, error)

func GetRunnerLogsDir added in v0.52.0

func GetRunnerLogsDir(configDir string) string

func GetTargetLogsDir added in v0.52.0

func GetTargetLogsDir(configDir string) string

func GetWorkspaceLogsDir added in v0.11.0

func GetWorkspaceLogsDir(configDir string) string

func IsLogFileNotFound added in v0.47.0

func IsLogFileNotFound(err error) bool

func Save added in v0.11.0

func Save(c Config) error

Types

type Config added in v0.11.0

type Config struct {
	RegistryUrl               string              `json:"registryUrl" validate:"required"`
	Id                        string              `json:"id" validate:"required"`
	ServerDownloadUrl         string              `json:"serverDownloadUrl" validate:"required"`
	Frps                      *FRPSConfig         `json:"frps,omitempty" validate:"optional"`
	ApiPort                   uint32              `json:"apiPort" validate:"required"`
	HeadscalePort             uint32              `json:"headscalePort" validate:"required"`
	BinariesPath              string              `json:"binariesPath" validate:"required"`
	LogFile                   *logs.LogFileConfig `json:"logFile" validate:"required"`
	BuilderImage              string              `json:"builderImage" validate:"required"`
	DefaultWorkspaceImage     string              `json:"defaultWorkspaceImage" validate:"required"`
	DefaultWorkspaceUser      string              `json:"defaultWorkspaceUser" validate:"required"`
	LocalBuilderRegistryPort  uint32              `json:"localBuilderRegistryPort" validate:"required"`
	LocalBuilderRegistryImage string              `json:"localBuilderRegistryImage" validate:"required"`
	BuilderRegistryServer     string              `json:"builderRegistryServer" validate:"required"`
	BuildImageNamespace       string              `json:"buildImageNamespace" validate:"optional"`
	LocalRunnerDisabled       *bool               `json:"localRunnerDisabled" validate:"optional"`
	SamplesIndexUrl           string              `json:"samplesIndexUrl" validate:"optional"`

} // @name ServerConfig

func GetConfig added in v0.11.0

func GetConfig() (*Config, error)

type FRPSConfig added in v0.11.0

type FRPSConfig struct {
	Domain   string `json:"domain" validate:"required"`
	Port     uint32 `json:"port" validate:"required"`
	Protocol string `json:"protocol" validate:"required"`

} // @name FRPSConfig

type ILocalContainerRegistry added in v0.17.0

type ILocalContainerRegistry interface {
	Start() error
	Stop() error
	Purge() error
}

type NetworkKey added in v0.11.0

type NetworkKey struct {
	Key string `json:"key" validate:"required"`

} // @name NetworkKey

type Server added in v0.11.0

type Server struct {
	Id string

	Version                    string
	TailscaleServer            TailscaleServer
	TargetConfigService        services.ITargetConfigService
	BuildService               services.IBuildService
	WorkspaceTemplateService   services.IWorkspaceTemplateService
	WorkspaceService           services.IWorkspaceService
	LocalContainerRegistry     ILocalContainerRegistry
	TargetService              services.ITargetService
	ApiKeyService              services.IApiKeyService
	GitProviderService         services.IGitProviderService
	EnvironmentVariableService services.IEnvironmentVariableService
	JobService                 services.IJobService
	RunnerService              services.IRunnerService
	TelemetryService           telemetry.TelemetryService
	// contains filtered or unexported fields
}

func GetInstance added in v0.11.0

func GetInstance(serverConfig *ServerInstanceConfig) *Server

func (*Server) FetchSamples added in v0.27.0

func (s *Server) FetchSamples() ([]sample.Sample, *http.Response, error)

func (*Server) GetBinaryPath added in v0.11.0

func (s *Server) GetBinaryPath(binaryName, binaryVersion string) (string, error)

Check if the requested binary is already downloaded, if not, download it

func (*Server) GetLogFiles added in v0.47.0

func (s *Server) GetLogFiles() ([]string, error)

func (*Server) GetLogReader added in v0.11.0

func (s *Server) GetLogReader(logFileQuery string) (io.Reader, error)

func (*Server) Initialize added in v0.36.0

func (s *Server) Initialize() error

type ServerInstanceConfig added in v0.11.0

type ServerInstanceConfig struct {
	Config                     Config
	Version                    string
	TailscaleServer            TailscaleServer
	TargetConfigService        services.ITargetConfigService
	BuildService               services.IBuildService
	WorkspaceTemplateService   services.IWorkspaceTemplateService
	WorkspaceService           services.IWorkspaceService
	LocalContainerRegistry     ILocalContainerRegistry
	TargetService              services.ITargetService
	ApiKeyService              services.IApiKeyService
	GitProviderService         services.IGitProviderService
	EnvironmentVariableService services.IEnvironmentVariableService
	JobService                 services.IJobService
	RunnerService              services.IRunnerService
	TelemetryService           telemetry.TelemetryService
}

type TailscaleServer added in v0.11.0

type TailscaleServer interface {
	Connect(username string) error
	CreateAuthKey(username string) (string, error)
	CreateUser(username string) error
	HTTPClient() *http.Client
	Dial(ctx context.Context, network, address string) (net.Conn, error)
	Start(errChan chan error) error
	Stop() error
	Purge() error
}

Jump to

Keyboard shortcuts

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