projects

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProjectNameMaxLength   = 255
	ClientNameMaxLength    = 255
	ProjectSearchMaxLength = 1024
)

Variables

View Source
var (
	ErrNotFound             = errors.New("project not found")
	ErrExists               = errors.New("project already exists")
	ErrHasClients           = errors.New("project has clients; deactivate clients to preserve history")
	ErrArchiveBusy          = errors.New("project archive is in progress")
	ErrConfirmationRequired = errors.New("project deletion requires its exact current name")
)

Functions

This section is empty.

Types

type ArchiveContentDeleter

type ArchiveContentDeleter interface {
	Backend() string
	Delete(ctx context.Context, key string) error
}

ArchiveContentDeleter removes archive files after their rows are gone. Delete is idempotent for missing content and must target only this backend.

type Client

type Client struct {
	ID   uuid.UUID `json:"id"`
	Name string    `json:"name"`
}

type PageQuery added in v0.0.11

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

PageQuery is constructed by NewPageQuery. Its zero value is the default first page.

func NewPageQuery added in v0.0.11

func NewPageQuery(search string, page, size int64) (PageQuery, error)

func (PageQuery) ClampPage added in v0.0.11

func (q PageQuery) ClampPage(maximum int64) PageQuery

ClampPage moves to an earlier available page without changing the search or size.

func (PageQuery) Page added in v0.0.11

func (q PageQuery) Page() int64

func (PageQuery) Search added in v0.0.11

func (q PageQuery) Search() string

func (PageQuery) Size added in v0.0.11

func (q PageQuery) Size() int64

type PostgresProjectsService

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

func NewPostgresProjectsService

func NewPostgresProjectsService(pool *pgxpool.Pool, archives ArchiveContentDeleter) *PostgresProjectsService

NewPostgresProjectsService uses archives to remove retained ZIPs after deletion.

func (*PostgresProjectsService) All added in v0.0.11

func (*PostgresProjectsService) ByIDs added in v0.0.11

func (p *PostgresProjectsService) ByIDs(ctx context.Context, ids []string) ([]Project, error)

func (*PostgresProjectsService) ClientBelongsToProject

func (p *PostgresProjectsService) ClientBelongsToProject(ctx context.Context, projectID, clientID string) (bool, error)

func (*PostgresProjectsService) ClientsForProjects added in v0.0.14

func (p *PostgresProjectsService) ClientsForProjects(ctx context.Context, projectIDs []uuid.UUID) ([]ProjectClient, error)

ClientsForProjects lists every client of the projects, including inactive ones.

func (*PostgresProjectsService) Create added in v0.0.11

func (*PostgresProjectsService) Delete added in v0.0.11

func (p *PostgresProjectsService) Delete(ctx context.Context, id, confirmationName string) error

func (*PostgresProjectsService) Get added in v0.0.11

func (*PostgresProjectsService) Page added in v0.0.11

func (*PostgresProjectsService) ProjectExists

func (p *PostgresProjectsService) ProjectExists(ctx context.Context, projectID, clientID string) bool

func (*PostgresProjectsService) Update added in v0.0.11

type Project

type Project struct {
	ID                 uuid.UUID `json:"id"`
	Name               string    `json:"name"`
	Clients            []Client  `json:"clients"`
	HasRetainedClients bool      `json:"hasRetainedClients"`
	TotalStorageSize   float64   `json:"totalStorageSize"`
}

func (Project) ClientNames

func (p Project) ClientNames() []string

type ProjectClient added in v0.0.14

type ProjectClient struct {
	ID        uuid.UUID
	ProjectID uuid.UUID
	Name      string
	Active    bool
}

ProjectClient is a client of any status. Inactive clients keep their retained logs readable.

type ProjectInput added in v0.0.11

type ProjectInput struct {
	Name    string
	Clients []string
}

Jump to

Keyboard shortcuts

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