service

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module(
	"service",
	fx.Provide(
		New,
	),
)

Functions

This section is empty.

Types

type CreateDefaultModel

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

type DefaultModel

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

func NewDefaultModel

func NewDefaultModel(e *gen.DefaultModel) DefaultModel

func NewDefaultModelList

func NewDefaultModelList(es []*gen.DefaultModel) []DefaultModel

func (DefaultModel) GetID

func (s DefaultModel) GetID() uuid.UUID

GetID returns the value of ID.

func (DefaultModel) GetName

func (s DefaultModel) GetName() string

GetName returns the value of ID.

type DefaultModelList

type DefaultModelList struct {
	Items []DefaultModel
}

type DefaultModelListParams

type DefaultModelListParams struct {
	Page         Opt[int]
	ItemsPerPage Opt[int]
}

type DefaultModelQueryModifier

type DefaultModelQueryModifier func(ctx context.Context, q *gen.DefaultModelQuery) error

type DefaultModelReadParams

type DefaultModelReadParams struct {
	ID uuid.UUID
}

type Opt

type Opt[T any] struct {
	// contains filtered or unexported fields
}

func (*Opt[T]) Get

func (o *Opt[T]) Get() T

func (*Opt[T]) IsSet

func (o *Opt[T]) IsSet() bool

func (*Opt[T]) Set

func (o *Opt[T]) Set(v T)

type Service

type Service struct {
	DefaultModelListQueryModifier DefaultModelQueryModifier
	DefaultModelReadQueryModifier DefaultModelQueryModifier
	// contains filtered or unexported fields
}

func New

func New(client *gen.Client, logger *zap.Logger) *Service

func (*Service) CreateDefaultModel

func (h *Service) CreateDefaultModel(ctx context.Context, req CreateDefaultModel) (DefaultModel, error)

func (*Service) DeleteDefaultModel

func (h *Service) DeleteDefaultModel(ctx context.Context, id uuid.UUID) error

DeleteDefaultModel handles DELETE /defaultmodel/{id} requests.

func (*Service) ListDefaultModel

func (h *Service) ListDefaultModel(ctx context.Context, params DefaultModelListParams) (DefaultModelList, error)

func (*Service) ReadDefaultModel

func (h *Service) ReadDefaultModel(ctx context.Context, params DefaultModelReadParams) (DefaultModel, error)

func (*Service) UpdateDefaultModel

func (h *Service) UpdateDefaultModel(ctx context.Context, id uuid.UUID, req UpdateDefaultModel) (DefaultModel, error)

type UpdateDefaultModel

type UpdateDefaultModel struct {
	ID   Opt[uuid.UUID] `json:"id"`
	Name Opt[string]    `json:"name"`
}

Jump to

Keyboard shortcuts

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