domains

package
Version: v0.0.0-...-0b542b9 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscountRequest

type DiscountRequest struct {
	UserId    string `json:"user_id" validate:"required"`
	ProductId string `json:"product_id" validate:"required"`
}

type DiscountResponse

type DiscountResponse struct {
	UserId       string  `json:"user_id" validate:"required"`
	ProductId    string  `json:"product_id" validate:"required"`
	Percentage   float32 `json:"percentage" `
	ValueInCents float32 `json:"value_in_cents" `
}

type EventRequest

type EventRequest interface {
	EventId() string
	EventType() string
	Operation() string
}

type Product

type Product struct {
	Id           *string    `projection:"id"`
	PriceInCents *int64     `projection:"price_in_cents"`
	Title        *string    `projection:"title" `
	Description  *string    `projection:"description"`
	CreatedAt    time.Time  `projection:"created_at"`
	UpdatedAt    time.Time  `projection:"updated_at"`
	DeletedAt    *time.Time `projection:"deleted_at"`
	Discount     *ProductDiscount
}

type ProductCreate

type ProductCreate struct {
	PriceInCents int64  `validate:"required"`
	Title        string `validate:"required"`
	Description  string `validate:"required"`
}

type ProductCreateRequestV1

type ProductCreateRequestV1 struct {
	PriceInCents int64  `json:"price_in_cents" validate:"required"`
	Title        string `json:"title" validate:"required,min=1"`
	Description  string `json:"description" validate:"required,min=1"`
}

func (*ProductCreateRequestV1) ProductCreate

func (c *ProductCreateRequestV1) ProductCreate() ProductCreate

type ProductCreateResponseV1

type ProductCreateResponseV1 struct {
	Id           string `json:"id" validate:"required"`
	PriceInCents int64  `json:"price_in_cents" validate:"required"`
	Title        string `json:"title" validate:"required,min=1"`
	Description  string `json:"description" validate:"required,min=1"`
}

type ProductCreatedUpdatedEventRequest

type ProductCreatedUpdatedEventRequest struct {
	ProductId    string `json:"product_id" validate:"required"`
	Title        string `json:"title" validate:"required"`
	Description  string `json:"description" validate:"required"`
	PriceInCents int64  `json:"price_in_cents" validate:"required"`
	// contains filtered or unexported fields
}

func NewProductCreatedEventRequest

func NewProductCreatedEventRequest(ctx context.Context, productId, title, description string, priceInCents int64) ProductCreatedUpdatedEventRequest

func NewProductDeletedEventRequest

func NewProductDeletedEventRequest(ctx context.Context, productId, title, description string, priceInCents int64) ProductCreatedUpdatedEventRequest

func NewProductUpdatedEventRequest

func NewProductUpdatedEventRequest(ctx context.Context, productId, title, description string, priceInCents int64) ProductCreatedUpdatedEventRequest

func (ProductCreatedUpdatedEventRequest) EventId

func (ProductCreatedUpdatedEventRequest) EventType

func (ProductCreatedUpdatedEventRequest) Operation

type ProductDiscount

type ProductDiscount struct {
	Percentage   float64 `json:"percentage"`
	ValueInCents float64 `json:"value_in_cents"`
}

type ProductFilter

type ProductFilter struct {
	Id           *string    `filter:"id"`
	PriceInCents *int64     `filter:"price_in_cents"`
	Title        *string    `filter:"title"`
	Description  *string    `filter:"description"`
	DeletedAt    *time.Time `filter:"deleted_at"`
}

type ProductGetResponseV1

type ProductGetResponseV1 struct {
	Id           string           `json:"id"`
	PriceInCents int64            `json:"price_in_cents"`
	Title        string           `json:"title"`
	Description  *string          `json:"description"`
	Discount     *ProductDiscount `json:"discount"`
}

type ProductListResponseV1

type ProductListResponseV1 struct {
	Products []ProductGetResponseV1 `json:"products"`
}

type ProductProjection

type ProductProjection struct {
	Id           bool `projection:"id"`
	PriceInCents bool `projection:"price_in_cents"`
	Title        bool `projection:"title"`
	Description  bool `projection:"description"`
	CreatedAt    bool `projection:"created_at"`
	UpdatedAt    bool `projection:"updated_at"`
	DeletedAt    bool `projection:"deleted_at"`
}

type ProductSearch

type ProductSearch struct {
	Filter     ProductFilter
	Projection ProductProjection
}

type ProductUpdate

type ProductUpdate struct {
	Id           string  `validate:"required"`
	PriceInCents *int64  `validate:"omitempty,required"`
	Title        *string `validate:"omitempty,min=1"`
	Description  *string `validate:"omitempty,min=1"`
}

type ProductUpdateRequestV1

type ProductUpdateRequestV1 struct {
	PriceInCents *int64  `json:"price_in_cents"`
	Title        *string `json:"title" validate:"omitempty,min=1"`
	Description  *string `json:"description" validate:"omitempty,min=1"`
}

func (*ProductUpdateRequestV1) ProductUpdate

func (c *ProductUpdateRequestV1) ProductUpdate(productId string) ProductUpdate

type ProductUpdateResponseV1

type ProductUpdateResponseV1 struct {
	Id           string `json:"id" validate:"required"`
	PriceInCents int64  `json:"price_in_cents" validate:"required"`
	Title        string `json:"title" validate:"required,min=1"`
	Description  string `json:"description" validate:"omitempty,min=1"`
}

type Span

type Span struct {
	Name         string                 `validate:"required"`
	Cid          string                 `validate:"required"`
	Resource     string                 `validate:"required"`
	Version      string                 `validate:"required"`
	OrgId        string                 `validate:"required"`
	Line         int                    `validate:"required"`
	FuncName     string                 `validate:"required"`
	FileName     string                 `validate:"required"`
	Custom       map[string]interface{} `validate:"required"`
	InternalSpan zipkin.Span
}

func (*Span) Error

func (s *Span) Error(err error) *Span

func (*Span) Finish

func (s *Span) Finish()

func (*Span) Tag

func (s *Span) Tag(k string, v interface{}) *Span

type SpanConfig

type SpanConfig interface {
	Apply(ctx context.Context, s *Span)
}

func WithCustom

func WithCustom(k string, v interface{}) SpanConfig

func WithName

func WithName(v string) SpanConfig

func WithOrgId

func WithOrgId(v string) SpanConfig

type TypeEvent

type TypeEvent string
var (
	ProductsTypeEvent TypeEvent = "products"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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