htmlui

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthCtrl

type AuthCtrl interface {
	GetUserForCredentials(ctx context.Context, query control.GetUserForCredentialsQuery) (*auth.User, map[string]string, error)
	ChangeUserCredentials(ctx context.Context, cmd control.ChangeUserCredentialsCmd) (map[string]string, error)
	CreateUser(ctx context.Context, cmd control.CreateUserCmd) error
	ResetPassword(ctx context.Context, cmd control.ResetPasswordCmd) error
	ToggleAdmin(ctx context.Context, id int64) error
	DeleteUser(ctx context.Context, userID int64) error
}

type Config

type Config struct {
	BaseURL          *url.URL
	DecimalSeparator string
	DefaultCurrency  string
	AssetFilesDir    string
}

type ExporterCtrl

type ExporterCtrl interface {
	Export(ctx context.Context, w io.Writer, cmd control.ExportCmd) error
}

type FileCtrl

type FileCtrl interface {
	Get(ctx context.Context, id int64) (*entities.File, error)
	WriteFile(ctx context.Context, file *entities.File) (*entities.File, error)
	Delete(ctx context.Context, id int64) error
}

type ImporterCtrl

type ImporterCtrl interface {
	Import(r *http.Request, cmd control.ImportCmd) (map[string]string, error)
}

type LabelCtrl

type LabelCtrl interface {
	GenerateLabelSheet(ctx context.Context, query control.GenerateLabelSheetQuery) ([]byte, error)
}

type Router

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

func NewRouter

func NewRouter(
	mux chi.Router,
	config Config,
	auth AuthCtrl,
	assets AssetCtrl,
	files FileCtrl,
	tags TagCtrl,
	users UserCtrl,
	importer ImporterCtrl,
	exporter ExporterCtrl,
	labels LabelCtrl,
) *Router

type TagCtrl

type TagCtrl interface {
	List(ctx context.Context, query control.ListTagsQuery) (*entities.ListPage[*entities.Tag], error)
	GetNext(ctx context.Context) (string, error)
}

type UserCtrl

type UserCtrl interface {
	List(ctx context.Context, query control.ListUsersQuery) (*entities.ListPage[*auth.User], error)
	Update(ctx context.Context, user *auth.User) error
	Get(ctx context.Context, id int64) (*auth.User, error)
	SetUserPreferences(ctx context.Context, user *auth.User) error
}

Jump to

Keyboard shortcuts

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