Documentation
¶
Index ¶
- Constants
- Variables
- type ArchiveContentDeleter
- type Client
- type PageQuery
- type PostgresProjectsService
- func (p *PostgresProjectsService) All(ctx context.Context) ([]Project, error)
- func (p *PostgresProjectsService) ByIDs(ctx context.Context, ids []string) ([]Project, error)
- func (p *PostgresProjectsService) ClientBelongsToProject(ctx context.Context, projectID, clientID string) (bool, error)
- func (p *PostgresProjectsService) ClientsForProjects(ctx context.Context, projectIDs []uuid.UUID) ([]ProjectClient, error)
- func (p *PostgresProjectsService) Create(ctx context.Context, input ProjectInput) (Project, error)
- func (p *PostgresProjectsService) Delete(ctx context.Context, id, confirmationName string) error
- func (p *PostgresProjectsService) Get(ctx context.Context, id string) (Project, error)
- func (p *PostgresProjectsService) Page(ctx context.Context, query PageQuery) ([]Project, int64, error)
- func (p *PostgresProjectsService) ProjectExists(ctx context.Context, projectID, clientID string) bool
- func (p *PostgresProjectsService) Update(ctx context.Context, id uuid.UUID, input ProjectInput) (Project, error)
- type Project
- type ProjectClient
- type ProjectInput
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 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
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 (p *PostgresProjectsService) All(ctx context.Context) ([]Project, error)
func (*PostgresProjectsService) ClientBelongsToProject ¶
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 (p *PostgresProjectsService) Create(ctx context.Context, input ProjectInput) (Project, error)
func (*PostgresProjectsService) Delete ¶ added in v0.0.11
func (p *PostgresProjectsService) Delete(ctx context.Context, id, confirmationName string) error
func (*PostgresProjectsService) ProjectExists ¶
func (p *PostgresProjectsService) ProjectExists(ctx context.Context, projectID, clientID string) bool
func (*PostgresProjectsService) Update ¶ added in v0.0.11
func (p *PostgresProjectsService) Update(ctx context.Context, id uuid.UUID, input ProjectInput) (Project, error)
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 ¶
type ProjectClient ¶ added in v0.0.14
ProjectClient is a client of any status. Inactive clients keep their retained logs readable.
type ProjectInput ¶ added in v0.0.11
Click to show internal directories.
Click to hide internal directories.