lib

package
v0.0.0-...-56da1e2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Categorizable

type Categorizable interface {
	Typeable
	Category() (string, bool)
}

type Category

type Category[S Categorizable, T Typeable] struct {
	ID     string `json:"id" dynamodbav:"SK"`
	Name   string `json:"name"`
	Val    T      `json:"item"`
	Public bool   `json:"-"  dynamodbav:"Public"`
	UserID string `json:"-"  dynamodbav:"UserID"`
}

func (Category[S, T]) Category

func (e Category[S, T]) Category() string

func (Category[S, T]) Deserialize

func (e Category[S, T]) Deserialize(resp map[string]types.AttributeValue) (Category[S, T], error)

func (Category[S, T]) DeserializeList

func (e Category[S, T]) DeserializeList(resps []map[string]types.AttributeValue) ([]Category[S, T], error)

func (Category[S, T]) PK

func (e Category[S, T]) PK() string

func (Category[S, T]) ParseID

func (e Category[S, T]) ParseID(s string) string

func (Category[S, T]) SK

func (e Category[S, T]) SK(s *string) string

func (Category[S, T]) Serialize

func (e Category[S, T]) Serialize() (map[string]types.AttributeValue, error)

func (Category[S, T]) Type

func (e Category[S, T]) Type() string

type Label

type Label struct {
	Val string
}

func (Label) Name

func (l Label) Name() string

type Nameable

type Nameable interface {
	Name() string
}

type Service

type Service[S Categorizable, T Typeable] interface {
	Create(context.Context, string, T) (T, error)
	Update(context.Context, string, T) (T, error)
	FindAll(context.Context, query.Opts) ([]T, error)
	FindByID(context.Context, string) (T, error)
	Delete(context.Context, string) error
}

type Typeable

type Typeable interface {
	Type() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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