manager

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCurrentDirectoryIsNotASession = fmt.Errorf("current directory is not a session")
	ErrSessionNotFound               = fmt.Errorf("session not found")
)
View Source
var (
	ErrEditorNotFound = errors.New("editor not found")
)
View Source
var (
	ErrInvalidSessionDisplayType = errors.New("invalid session display type")
)
View Source
var (
	ErrInvalidSessionSource = errors.New("invalid session source")
)
View Source
var (
	ErrInvalidSourceType = errors.New("invalid source type, must be repository")
)
View Source
var (
	ErrManagerNotFound = fmt.Errorf("manager not found in context")
)
View Source
var (
	ErrMissingTemplateName = errors.New("missing template name")
)
View Source
var (
	ErrUnknownTrackingType = errors.New("unknown tracking type")
)

Functions

func ContextWithManager

func ContextWithManager(ctx context.Context) context.Context

ContextWithManager returns a new context with the session manager

func GetManager

func GetManager(ctx context.Context) (*manager, error)

GetManager returns the session manager

Types

type CreateSessionArguments

type CreateSessionArguments struct {
	Source             string `json:"source"`
	ForceRequireExport bool   `json:"force_require_export"`
}

type ExportSessionArguments

type ExportSessionArguments struct {
	Path string
}

type ImportTemplateArguments

type ImportTemplateArguments struct {
	TemplateName  string
	RepositoryUrl string
}

type MonitorSessionArguments

type MonitorSessionArguments struct {
	Delay        time.Duration
	TrackingType editors.TrackingType
	PID          int
	Location     string
}

type PruneSessionArguments added in v1.5.0

type PruneSessionArguments struct {
	SessionID identifier.ID
}

type SaveSessionAsTemplateArguments

type SaveSessionAsTemplateArguments struct {
	TemplateName string `json:"template_name"`
}

type Session

type Session struct {
	ID       identifier.ID  `json:"id"`
	Location string         `json:"location"`
	PID      int            `json:"pid"`
	Source   Source         `json:"source"`
	Editor   editors.Editor `json:"editor"`
}

func (*Session) IsActive

func (s *Session) IsActive() bool

func (*Session) String

func (s *Session) String() string

type SessionDisplayType added in v1.5.0

type SessionDisplayType string
const (
	SessionDisplayTypeFull     SessionDisplayType = "full"
	SessionDisplayTypeLocation SessionDisplayType = "location"
	SessionDisplayTypePID      SessionDisplayType = "pid"
	SessionDisplayTypeEditor   SessionDisplayType = "editor"
	SessionDisplayTypeJSON     SessionDisplayType = "json"
)

func ParseSessionDisplayType added in v1.5.0

func ParseSessionDisplayType(v string) (SessionDisplayType, error)

type SessionSourceType

type SessionSourceType string
const (
	SessionSourceTypeRepository SessionSourceType = "repository"
	SessionSourceTypeDirectory  SessionSourceType = "directory"
	SessionSourceTypeTemplate   SessionSourceType = "template"
	SessionSourceTypeBlank      SessionSourceType = "blank"
)

func (SessionSourceType) FormattedString

func (s SessionSourceType) FormattedString() string

func (SessionSourceType) String

func (s SessionSourceType) String() string

type ShowSessionArguments added in v1.5.0

type ShowSessionArguments struct {
	SessionID  *identifier.ID
	OutputType SessionDisplayType
}

type Source added in v1.5.0

type Source struct {
	SourceType SessionSourceType `json:"sourceType"`
	Value      string            `json:"value"`
}

func (Source) FormattedValue added in v1.5.0

func (s Source) FormattedValue() string

func (Source) ShortValue added in v1.6.0

func (s Source) ShortValue() string

func (Source) String added in v1.5.0

func (s Source) String() string

type Template

type Template string

func (Template) AbsolutePath

func (t Template) AbsolutePath(ctx context.Context) string

func (Template) FormattedString

func (t Template) FormattedString(ctx context.Context) string

func (Template) StoragePath

func (t Template) StoragePath() string

func (Template) String

func (t Template) String() string

type UpdateTemplateArguments added in v1.5.0

type UpdateTemplateArguments struct {
	TemplateName string
}

Jump to

Keyboard shortcuts

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