webadmin

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(cfg Config) (http.Handler, error)

func SecurityHeaders

func SecurityHeaders(next http.Handler, secure bool) http.Handler

SecurityHeaders applies the browser security policy required by every admin response, including responses generated by outer routing middleware.

Types

type AdminBootstrapService

type AdminBootstrapService interface {
	HasAnyAPIKeys(ctx context.Context) (bool, error)
	BootstrapFirstAPIKey(ctx context.Context, namespace, label string) (service.CreateAPIKeyResult, error)
}

type AdminExecutionService

type AdminExecutionService interface {
	ListExecutions(ctx context.Context, filter domain.ExecutionFilter) ([]domain.Execution, error)
	GetExecution(ctx context.Context, id uuid.UUID) (domain.Execution, []domain.DeliveryAttempt, error)
}

type AdminJobActionService

type AdminJobActionService interface {
	PauseJob(ctx context.Context, id uuid.UUID) (domain.Job, error)
	ResumeJob(ctx context.Context, id uuid.UUID) (domain.Job, error)
	TriggerNow(ctx context.Context, id uuid.UUID) (domain.Execution, error)
	GetNextRunTime(ctx context.Context, id uuid.UUID) (time.Time, []time.Time, domain.Schedule, error)
}

type AdminJobService

type AdminJobService interface {
	ListJobsWithSchedules(ctx context.Context, filter domain.JobFilter) ([]domain.JobWithSchedule, error)
	CreateJob(ctx context.Context, input service.CreateJobInput) (domain.Job, domain.Schedule, error)
	GetJob(ctx context.Context, id uuid.UUID) (domain.Job, domain.Schedule, []domain.Tag, []domain.Execution, error)
	UpdateJob(ctx context.Context, id uuid.UUID, input service.UpdateJobInput) (domain.Job, domain.Schedule, error)
	DeleteJob(ctx context.Context, id uuid.UUID) error
}

type Config

type Config struct {
	Service            AdminService
	Sessions           domain.AdminSessionRepository
	Keys               keyLookup
	BootstrapToken     string
	SessionTTL         time.Duration
	SessionAbsoluteTTL time.Duration
	CookieSecure       bool
	Now                func() time.Time
	Logger             *log.Logger
}

type Handler

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

Jump to

Keyboard shortcuts

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