Documentation
¶
Index ¶
- type Frontend
- type FrontendVersion
- type Service
- func (s *Service) ActivateVersion(ctx context.Context, frontendID, versionID string) (*Frontend, error)
- func (s *Service) Create(ctx context.Context, name, slug, description string) (*Frontend, error)
- func (s *Service) CreateVersion(ctx context.Context, frontendID, label, description string, zipData []byte) (*FrontendVersion, error)
- func (s *Service) Delete(ctx context.Context, id string) error
- func (s *Service) DeleteVersion(ctx context.Context, frontendID, versionID string) error
- func (s *Service) Get(ctx context.Context, id string) (*Frontend, error)
- func (s *Service) GetBySlug(ctx context.Context, slug string) (*Frontend, error)
- func (s *Service) GetVersion(ctx context.Context, versionID string) (*FrontendVersion, error)
- func (s *Service) List(ctx context.Context) ([]Frontend, error)
- func (s *Service) ListVersions(ctx context.Context, frontendID string) ([]FrontendVersion, error)
- func (s *Service) Update(ctx context.Context, id, name, description string) (*Frontend, error)
- func (s *Service) VersionDir(frontendID, versionID string) string
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) 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) DeleteVersion ¶
DeleteVersion removes a version and its files. If the version is active, the frontend's active_version_id is cleared.
func (*Service) GetVersion ¶
GetVersion returns a single version by ID.
func (*Service) ListVersions ¶
ListVersions returns all versions for a frontend ordered by creation date descending.
func (*Service) VersionDir ¶
VersionDir returns the filesystem directory where a version's files are stored.