api

package
v0.0.1-alpha-1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const HandlersMarkAsPlanned = "recipes.planned.*"
View Source
const HandlersRecipeDelete = "recipes.delete.*"
View Source
const HandlersRecipeDetail = "recipes.detail.*"
View Source
const HandlersRecipeList = "recipes.list"
View Source
const HandlersRecipesUpsert = "recipes.upsert"
View Source
const StatusError = "error"
View Source
const StatusNotFound = "notfound"
View Source
const StatusSuccess = "success"

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, entc *ent.Client, lg *zap.Logger, natsURL string) error

func ZapHandler

func ZapHandler(handler string) zap.Field

func ZapRecipe

func ZapRecipe(recipe Recipe) zap.Field

func ZapRecipeID

func ZapRecipeID(recipeID uuid.UUID) zap.Field

func ZapRequestID

func ZapRequestID() zap.Field

Types

type Ack

type Ack struct {
	Status string `json:"status"`
}

type Envelope

type Envelope[T any] struct {
	Status string `json:"status"`
	Data   T      `json:"data"`
}

type List

type List []Recipe

type Recipe

type Recipe struct {
	ID      uuid.UUID `json:"id"`
	Name    string    `json:"name"`
	Planned bool      `json:"planned"`

	CreatedAt time.Time `json:"createdAt"`
}

func EntToRecipe

func EntToRecipe(r *ent.Recipe) Recipe

type RequestPlanned

type RequestPlanned struct {
	Planned bool `json:"planned"`
}

Jump to

Keyboard shortcuts

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