domain

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerStatusTerminated  = "Terminated"
	ServerStatusTerminating = "Terminating"
	ServerStatusPending     = "Pending"
	ServerStatusRunning     = "Running"
	ServerStatusUnknown     = "Unknown"
)
View Source
const (
	VolumeTypeNFS = "NFS"
	VolumeTypeTOS = "TOS" // not support
	VolumeTypeS3  = "S3"  // not support
)
View Source
const (
	ImportNotebookServers = "ImportNotebookServers"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateParam

type CreateParam struct {
	WorkspaceID  string
	Image        string
	ResourceSize notebook.ResourceSize
	Volumes      []Volume
}

type Factory

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

func NewFactory

func NewFactory(officialImages []string, sizeOptions []notebook.ResourceOption) *Factory

func (*Factory) GetResourceSizes

func (f *Factory) GetResourceSizes() []notebook.ResourceSize

func (*Factory) New

func (f *Factory) New(param *CreateParam) (*NotebookServer, error)

type ImportNotebookServersEvent

type ImportNotebookServersEvent struct {
	WorkspaceID       string
	Schema            schema.NotebookTypedSchema
	ImportFileBaseDir string
}

func NewImportNotebookServersEvent

func NewImportNotebookServersEvent(workspaceID, baseDir string, schema schema.NotebookTypedSchema) *ImportNotebookServersEvent

func NewImportNotebookServersEventFromPayload

func NewImportNotebookServersEventFromPayload(data []byte) (*ImportNotebookServersEvent, error)

func (*ImportNotebookServersEvent) Delay

func (*ImportNotebookServersEvent) EventType

func (e *ImportNotebookServersEvent) EventType() string

func (*ImportNotebookServersEvent) Payload

func (e *ImportNotebookServersEvent) Payload() []byte

type NotebookServer

type NotebookServer struct {
	ID          string
	WorkspaceID string
	Settings    Settings
	Status      Status
	Volumes     []Volume
	CreateTime  time.Time
	UpdateTime  time.Time
}

type Repository

type Repository interface {
	Save(context.Context, *NotebookServer) error
	Get(context.Context, string) (*NotebookServer, error)
	Delete(context.Context, *NotebookServer) error
}

Repository ...

type Service

type Service interface {
	Create(context.Context, *NotebookServer) error
	Update(context.Context, *NotebookServer) error
	Start(ctx context.Context, id string) error
	Stop(ctx context.Context, id string) error
	Delete(ctx context.Context, id string) error
}

func NewService

func NewService(repo Repository, runtime Runtime) Service

type Settings

type Settings struct {
	DockerImage  string
	ResourceSize notebook.ResourceSize
	NodeSelector map[string]string // no need to persistence
}

type Status

type Status struct {
	Status    string
	AccessURL string
}

type UnimplementedRuntime

type UnimplementedRuntime struct{}

func (UnimplementedRuntime) Create

func (UnimplementedRuntime) Delete

func (UnimplementedRuntime) GetStatus

func (UnimplementedRuntime) Start

func (UnimplementedRuntime) Stop

type Volume

type Volume struct {
	Name              string
	Type              string
	Source            string
	MountRelativePath string
}

Volume describe these storage needs except single user HOME persistence (runtime specified):

  1. workspace related storage
  2. ipynb file mount path

Jump to

Keyboard shortcuts

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