titleapp

package
v0.0.0-...-16ef530 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App manages the set of app layer api functions for the title domain.

func NewApp

func NewApp(titlebus *titlebus.Business) *App

NewApp constructs a title app API for use.

func NewAppWithAuth

func NewAppWithAuth(titlebus *titlebus.Business, ath *auth.Auth) *App

NewAppWithAuth constructs a title app API for use with auth support.

func (*App) Create

func (a *App) Create(ctx context.Context, app NewTitle) (Title, error)

Create adds a new title to the system

func (*App) Delete

func (a *App) Delete(ctx context.Context, id uuid.UUID) error

Delete removes an existing title

func (*App) Query

func (a *App) Query(ctx context.Context, qp QueryParams) (query.Result[Title], error)

Query returns a list of title based on the filter, order and page

func (*App) QueryByID

func (a *App) QueryByID(ctx context.Context, id uuid.UUID) (Title, error)

QueryByID retrieves the title by ID

func (*App) Update

func (a *App) Update(ctx context.Context, app UpdateTitle, id uuid.UUID) (Title, error)

Update updates an existing title

type NewTitle

type NewTitle struct {
	Description string `json:"description" validate:"required"`
	Name        string `json:"name" validate:"required,min=3,max=100"`
}

func (*NewTitle) Decode

func (app *NewTitle) Decode(data []byte) error

func (NewTitle) Validate

func (app NewTitle) Validate() error

type QueryParams

type QueryParams struct {
	Page        string
	Rows        string
	OrderBy     string
	ID          string
	Description string
	Name        string
}

type Title

type Title struct {
	ID          string `json:"id"`
	Description string `json:"description"`
	Name        string `json:"name"`
}

func ToAppTitle

func ToAppTitle(bus titlebus.Title) Title

func ToAppTitles

func ToAppTitles(bus []titlebus.Title) []Title

func (Title) Encode

func (app Title) Encode() ([]byte, string, error)

type UpdateTitle

type UpdateTitle struct {
	Description *string `json:"description" validate:"required"`
	Name        *string `json:"name" validate:"required,min=3,max=100"`
}

func (*UpdateTitle) Decode

func (app *UpdateTitle) Decode(data []byte) error

func (UpdateTitle) Validate

func (app UpdateTitle) Validate() error

Jump to

Keyboard shortcuts

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