server

package
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigDir added in v0.11.0

func GetConfigDir() (string, error)

func GetWorkspaceLogsDir added in v0.11.0

func GetWorkspaceLogsDir() (string, error)

func Save added in v0.11.0

func Save(c Config) error

Types

type Config added in v0.11.0

type Config struct {
	ProvidersDir                    string      `json:"providersDir"`
	RegistryUrl                     string      `json:"registryUrl"`
	Id                              string      `json:"id"`
	ServerDownloadUrl               string      `json:"serverDownloadUrl"`
	Frps                            *FRPSConfig `json:"frps,omitempty"`
	ApiPort                         uint32      `json:"apiPort"`
	HeadscalePort                   uint32      `json:"headscalePort"`
	BinariesPath                    string      `json:"binariesPath"`
	LogFilePath                     string      `json:"logFilePath"`
	DefaultProjectImage             string      `json:"defaultProjectImage"`
	DefaultProjectUser              string      `json:"defaultProjectUser"`
	DefaultProjectPostStartCommands []string    `json:"defaultProjectPostStartCommands"`
	BuilderImage                    string      `json:"builderImage"`
	LocalBuilderRegistryPort        uint32      `json:"localBuilderRegistryPort"`
	BuilderRegistryServer           string      `json:"builderRegistryServer"`
	BuildImageNamespace             string      `json:"buildImageNamespace"`

} // @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"`
	Port     uint32 `json:"port"`
	Protocol string `json:"protocol"`

} // @name FRPSConfig

type ILocalContainerRegistry added in v0.17.0

type ILocalContainerRegistry interface {
	Start() error
}

type NetworkKey added in v0.11.0

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

} // @name NetworkKey

type Server added in v0.11.0

type Server struct {
	TailscaleServer          TailscaleServer
	ProviderTargetService    providertargets.IProviderTargetService
	ContainerRegistryService containerregistries.IContainerRegistryService
	LocalContainerRegistry   ILocalContainerRegistry
	WorkspaceService         workspaces.IWorkspaceService
	ApiKeyService            apikeys.IApiKeyService
	GitProviderService       gitproviders.IGitProviderService
	ProviderManager          manager.IProviderManager
	ProfileDataService       profiledata.IProfileDataService
	// contains filtered or unexported fields
}

func GetInstance added in v0.11.0

func GetInstance(serverConfig *ServerInstanceConfig) *Server

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) GetLogReader added in v0.11.0

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

func (*Server) Start added in v0.11.0

func (s *Server) Start(errCh chan error) error

type ServerInstanceConfig added in v0.11.0

type ServerInstanceConfig struct {
	Config                   Config
	TailscaleServer          TailscaleServer
	ProviderTargetService    providertargets.IProviderTargetService
	ContainerRegistryService containerregistries.IContainerRegistryService
	LocalContainerRegistry   ILocalContainerRegistry
	WorkspaceService         workspaces.IWorkspaceService
	ApiKeyService            apikeys.IApiKeyService
	GitProviderService       gitproviders.IGitProviderService
	ProviderManager          manager.IProviderManager
	ProfileDataService       profiledata.IProfileDataService
}

type TailscaleServer added in v0.11.0

type TailscaleServer interface {
	Connect() error
	CreateAuthKey() (string, error)
	CreateUser() error
	HTTPClient() *http.Client
	Start() error
}

Jump to

Keyboard shortcuts

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