e2eutils

package
v0.29.4-dev-56e4e32 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminSetup

func AdminSetup(email, password, name string) error

func CheckResults

func CheckResults(t *testing.T, expectedTesults map[fileevent.Code]int64, forcedJSON bool, recorder *fileevent.Recorder) bool

func CreateApiKey

func CreateApiKey(token Token, name string, permissions []string) (string, error)

func CreateUser

func CreateUser(adminToken Token, email string, password string, name string) error

func ExecWithTimeout

func ExecWithTimeout(ctx context.Context, timeout time.Duration, command string, args ...string) error

ExecWithTimeout executes a command with a timeout and context support

func GetAndTransformDockerFile

func GetAndTransformDockerFile(ctx context.Context, url string) ([]byte, error)

func GetFile

func GetFile(ctx context.Context, url string) ([]byte, error)

GetFile downloads a file from the given URL with context support for cancellation

func Local

func Local(p string) func(ctx context.Context, ictlr *ImmichController) error

Local configures the control on the host machine

func Remote

func Remote(sshhost, immichUrl, dcPath string) func(ctx context.Context, ictlr *ImmichController) error

Remote configures the controller to use SSH for remote operations

func RunWithTimeout

func RunWithTimeout(timeout time.Duration, f func(ctx context.Context) error) error

RunWithTimeout runs a function with a timeout context

func SetUserOnboarding

func SetUserOnboarding(token Token, onboarding bool) error

Types

type ErrorResponse

type ErrorResponse struct {
	Message       any    `json:"message"`
	Error         string `json:"error"`
	StatusCode    int    `json:"statusCode"`
	CorrelationID string `json:"correlationId"`
}

func (ErrorResponse) GetMessage

func (e ErrorResponse) GetMessage() string

GetMessage concatenates all messages into a single string, handling both string and []string formats

type ImmichController

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

func NewImmichController

func NewImmichController(p string) (*ImmichController, error)

NewImmichController creates a new controller with the specified path

func OpenImmichController

func OpenImmichController(ctx context.Context, initializer func(ctx context.Context, ictlr *ImmichController) error) (*ImmichController, error)

OpenImmichController opens a new ImmichController instance with the specified docker-compose file path

func (*ImmichController) DeployImmich

func (ictlr *ImmichController) DeployImmich(ctx context.Context) error

DeployImmich downloads Immich configuration files from the application web page and prepares the Docker environment

func (*ImmichController) GetDockerComposeFile

func (ictlr *ImmichController) GetDockerComposeFile() string

func (*ImmichController) ImmichGet

func (ictlr *ImmichController) ImmichGet(ctx context.Context) error

ImmichGet performs a complete Immich setup: downloads configuration files, starts services, and waits for API readiness

func (*ImmichController) IsRemote

func (ictlr *ImmichController) IsRemote() bool

IsRemote returns true if the controller is configured for remote SSH access

func (*ImmichController) PauseImmichServer

func (ictlr *ImmichController) PauseImmichServer(ctx context.Context) error

PauseImmichServer stops the Immich server container specifically

func (*ImmichController) PingAPI

func (ictlr *ImmichController) PingAPI(ctx context.Context) error

PingAPI performs a quick health check on the Immich API server

func (*ImmichController) ResumeImmichServer

func (ictlr *ImmichController) ResumeImmichServer(ctx context.Context) error

ResumeImmichServer starts the Immich server container in detached mode

func (*ImmichController) RunImmich

func (ictlr *ImmichController) RunImmich(ctx context.Context) error

RunImmich starts the Immich services using docker compose

func (*ImmichController) StopImmich

func (ictlr *ImmichController) StopImmich(ctx context.Context) error

StopImmich stops the Immich services using docker compose

func (*ImmichController) WaitAPI

func (ictlr *ImmichController) WaitAPI(ctx context.Context, timeout time.Duration) error

WaitAPI waits for the Immich API to become available by polling the ping endpoint during 30 seconds

type Keys

type Keys map[string]any

func KeysFromFile

func KeysFromFile(path string) (Keys, error)

func (Keys) Get

func (keys Keys) Get(k string) string

Get retrieves the value associated with the given key path (using "/" as a separator for nested keys). If the key is not found or the value is not a string, it returns an empty string.

type Token

type Token string

func UserLogin

func UserLogin(email, password string) (Token, error)

Directories

Path Synopsis
cmd
createUser command

Jump to

Keyboard shortcuts

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