service

package
v0.0.0-...-25ffe3b Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetReader

type AssetReader struct {
	models.ReadAssetRow
	// contains filtered or unexported fields
}

func (*AssetReader) Read

func (r *AssetReader) Read(b []byte) (int, error)

type AssetService

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

func NewAssetService

func NewAssetService(transactions *TransactionService) *AssetService

func (*AssetService) Reader

func (s *AssetService) Reader(ctx context.Context, id xid.ID) (*AssetReader, error)

func (*AssetService) ThumbnailReader

func (s *AssetService) ThumbnailReader(ctx context.Context, id xid.ID, size ThumbnailSize) (*AssetReader, error)

func (*AssetService) Writer

func (s *AssetService) Writer(ctx context.Context, filename, mediaTyp string) (*AssetWriter, error)

type AssetWriter

type AssetWriter struct {
	models.Asset
	// contains filtered or unexported fields
}

func (*AssetWriter) Close

func (w *AssetWriter) Close() error

func (*AssetWriter) Write

func (w *AssetWriter) Write(b []byte) (int, error)

type RecipeService

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

func NewRecipeService

func NewRecipeService(
	transactions *TransactionService,
	assets *AssetService,
	parser *parser.RecipeParser,
) *RecipeService

func (*RecipeService) Create

func (s *RecipeService) Create(ctx context.Context, content []byte) (xid.ID, error)

func (*RecipeService) Delete

func (s *RecipeService) Delete(ctx context.Context, id xid.ID) error

func (*RecipeService) ImageWriter

func (s *RecipeService) ImageWriter(ctx context.Context, id xid.ID, filename, mediaType string) (*AssetWriter, error)

func (*RecipeService) List

func (*RecipeService) ListImages

func (s *RecipeService) ListImages(ctx context.Context, id xid.ID) ([]models.Asset, error)

func (*RecipeService) Read

func (s *RecipeService) Read(ctx context.Context, id xid.ID) ([]byte, error)

func (*RecipeService) Update

func (s *RecipeService) Update(ctx context.Context, id xid.ID, content []byte) error

type ThumbnailSize

type ThumbnailSize uint8
const (
	ThumbnailUnknown ThumbnailSize = iota
	ThumbnailTile
	ThumbnailBanner
)

func (ThumbnailSize) String

func (s ThumbnailSize) String() string

func (*ThumbnailSize) UnmarshalText

func (s *ThumbnailSize) UnmarshalText(text []byte) error

type TransactionService

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

func NewTransactionService

func NewTransactionService(db *sql.DB) *TransactionService

func (*TransactionService) Querier

func (*TransactionService) Transactional

func (s *TransactionService) Transactional(ctx context.Context, fn func(context.Context) error) error

Jump to

Keyboard shortcuts

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