frontend

package
v0.0.0-...-4009ad3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Frontend

type Frontend struct {
	ID              string    `json:"id"`
	Name            string    `json:"name"`
	Slug            string    `json:"slug"`
	Description     string    `json:"description"`
	ActiveVersionID string    `json:"active_version_id"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
}

Frontend represents a named frontend app with a set of uploadable versions.

type FrontendVersion

type FrontendVersion struct {
	ID          string    `json:"id"`
	FrontendID  string    `json:"frontend_id"`
	Label       string    `json:"label"`
	Description string    `json:"description"`
	FileCount   int       `json:"file_count"`
	CreatedAt   time.Time `json:"created_at"`
}

FrontendVersion represents a snapshot of uploaded files for a frontend.

type Service

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

Service manages frontends and their versions.

func NewService

func NewService(db *sql.DB, store *storage.LocalAdapter) *Service

NewService creates a new frontend service.

func (*Service) ActivateVersion

func (s *Service) ActivateVersion(ctx context.Context, frontendID, versionID string) (*Frontend, error)

ActivateVersion sets the active version for a frontend.

func (*Service) Create

func (s *Service) Create(ctx context.Context, name, slug, description string) (*Frontend, error)

Create inserts a new frontend record.

func (*Service) CreateVersion

func (s *Service) CreateVersion(ctx context.Context, frontendID, label, description string, zipData []byte) (*FrontendVersion, error)

CreateVersion extracts a ZIP archive and stores all files under the new version.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, id string) error

Delete removes a frontend and all its versions and stored files.

func (*Service) DeleteVersion

func (s *Service) DeleteVersion(ctx context.Context, frontendID, versionID string) error

DeleteVersion removes a version and its files. If the version is active, the frontend's active_version_id is cleared.

func (*Service) Get

func (s *Service) Get(ctx context.Context, id string) (*Frontend, error)

Get returns a single frontend by ID.

func (*Service) GetBySlug

func (s *Service) GetBySlug(ctx context.Context, slug string) (*Frontend, error)

GetBySlug returns a single frontend by slug.

func (*Service) GetVersion

func (s *Service) GetVersion(ctx context.Context, versionID string) (*FrontendVersion, error)

GetVersion returns a single version by ID.

func (*Service) List

func (s *Service) List(ctx context.Context) ([]Frontend, error)

List returns all frontends ordered by creation date descending.

func (*Service) ListVersions

func (s *Service) ListVersions(ctx context.Context, frontendID string) ([]FrontendVersion, error)

ListVersions returns all versions for a frontend ordered by creation date descending.

func (*Service) Update

func (s *Service) Update(ctx context.Context, id, name, description string) (*Frontend, error)

Update modifies the name and description of a frontend.

func (*Service) VersionDir

func (s *Service) VersionDir(frontendID, versionID string) string

VersionDir returns the filesystem directory where a version's files are stored.

Jump to

Keyboard shortcuts

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