shop

package module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

README

Build Status codecov GoDoc Go Report Card

Shop API

Shop is an API for publishing, listing and viewing articles in a shop.

Development

Migrations
cd migrations
sql-migrate up
Models

From project root, Re-generate the models with:

sqlboiler psql
go test ./models
Testdata

A test data set can be generated using the testdata tool. It relies on wordlists, which are in a Git submodule of this repository.

After installing the tool and the wordlists, run:

testdata -schema testdata.json

Connection details and schema definitions are in the testdata.json file. Please don't modify the Seed, Min and Max values for columns, as it changes the determinism of the data.

Protocol buffers

The shop API server uses gRPC through protocol buffers generation. To regenerate the gRPC definitions, run:

protoc --go_out=plugins=grpc:. --go_opt=paths=source_relative shop.proto
Benchmarks

Currently benchmarks are split between adaptor code and data code. For the latter a test data set must be loaded before execution.

Query builer

$ go test -bench . ./builder
...
BenchmarkArticleListQueryAllAll-8          41234             26462 ns/op
BenchmarkArticleListQueryImgCats-8        124092              9852 ns/op
BenchmarkArticleListDefaults-8            168234              7596 ns/op
BenchmarkArticleListWithFilters-8         164244              8273 ns/op

Adaptors

$ go test -bench . -tags adapt ./cmd/server
...
Benchmark_checkRequired-8                        9526696               123 ns/op
Benchmark_articleMsgToModel-8                    1561299               755 ns/op
Benchmark_imagesMsgToModel-8                     1418565               810 ns/op
Benchmark_videosMsgToModel-8                     1517041               834 ns/op
Benchmark_timeModelToMsg-8                       8821671               136 ns/op
Benchmark_orderMsgToModel-8                      2246192               542 ns/op
Benchmark_checkOrderArticles-8                  15703666                75.1 ns/op
Benchmark_orderArticlesModelsToMsg-8              607324              1904 ns/op
Benchmark_orderModelToMsg-8                      4236904               290 ns/op
Benchmark_jsonScanner_Scan-8                       92625             12256 ns/op
Benchmark_jsonScanner_articlesJSONtoMsg-8          38359             31360 ns/op

Article list benchmarks are a work in progress. Currently it runs against a set of 10.000 articles, random-ish filtered on category ID, published and promoted. The query returns relations in JSON documents, which is than converted to the gRPC types.

$ go test -bench . -tags data -benchtime=1000x ./cmd/server
...
Benchmark_transaction_jsonQuery-8                   1000           3049734 ns/op
Benchmark_transaction_listArticles-8                1000           2964290 ns/op
Benchmark_shopServer_ListArticles_serial-8          1000           3120801 ns/op
Benchmark_shopServer_ListArticles_routines-8        1000           2996836 ns/op

Documentation

Overview

Package shop is an eCommerce API used for publishing, listing, filtering and checkout of articles. This API is accessible through the gRPC protocol. The documentation is based on protobuf generated code.

The protobuf file can be found at: https://github.com/moapis/shop/blob/master/shop.proto. More information on gRPC: https://grpc.io/docs/. Protocol buffers: https://developers.google.com/protocol-buffers/docs/overview.

Index

Constants

This section is empty.

Variables

View Source
var (
	MediaFields_name = map[int32]string{
		0: "MD_ALL",
		1: "MD_ID",
		2: "MD_LABEL",
		3: "MD_URL",
	}
	MediaFields_value = map[string]int32{
		"MD_ALL":   0,
		"MD_ID":    1,
		"MD_LABEL": 2,
		"MD_URL":   3,
	}
)

Enum value maps for MediaFields.

View Source
var (
	BasePriceFields_name = map[int32]string{
		0: "BP_ALL",
		1: "BP_ID",
		2: "BP_CREATED",
		3: "BP_UPDATED",
		4: "BP_LABEL",
		5: "BP_PRICE",
	}
	BasePriceFields_value = map[string]int32{
		"BP_ALL":     0,
		"BP_ID":      1,
		"BP_CREATED": 2,
		"BP_UPDATED": 3,
		"BP_LABEL":   4,
		"BP_PRICE":   5,
	}
)

Enum value maps for BasePriceFields.

View Source
var (
	VariantFields_name = map[int32]string{
		0: "VRT_ALL",
		1: "VRT_ID",
		2: "VRT_CREATED",
		3: "VRT_UPDATED",
		4: "VRT_LABELS",
		5: "VRT_MULTIPLIER",
	}
	VariantFields_value = map[string]int32{
		"VRT_ALL":        0,
		"VRT_ID":         1,
		"VRT_CREATED":    2,
		"VRT_UPDATED":    3,
		"VRT_LABELS":     4,
		"VRT_MULTIPLIER": 5,
	}
)

Enum value maps for VariantFields.

View Source
var (
	ArticleFields_name = map[int32]string{
		0:  "ALL",
		1:  "ID",
		2:  "CREATED",
		3:  "UPDATED",
		4:  "PUBLISHED",
		5:  "TITLE",
		6:  "DESCRIPTION",
		7:  "PRICE",
		11: "PROMOTED",
	}
	ArticleFields_value = map[string]int32{
		"ALL":         0,
		"ID":          1,
		"CREATED":     2,
		"UPDATED":     3,
		"PUBLISHED":   4,
		"TITLE":       5,
		"DESCRIPTION": 6,
		"PRICE":       7,
		"PROMOTED":    11,
	}
)

Enum value maps for ArticleFields.

View Source
var (
	CategoryFields_name = map[int32]string{
		0: "CAT_ALL",
		1: "CAT_ID",
		2: "CAT_CREATED",
		3: "CAT_UPDATED",
		4: "CAT_LABEL",
	}
	CategoryFields_value = map[string]int32{
		"CAT_ALL":     0,
		"CAT_ID":      1,
		"CAT_CREATED": 2,
		"CAT_UPDATED": 3,
		"CAT_LABEL":   4,
	}
)

Enum value maps for CategoryFields.

View Source
var (
	Order_PaymentMethod_name = map[int32]string{
		0: "CASH_ON_DELIVERY",
		1: "BANK_TRANSFER",
		2: "ONLINE",
	}
	Order_PaymentMethod_value = map[string]int32{
		"CASH_ON_DELIVERY": 0,
		"BANK_TRANSFER":    1,
		"ONLINE":           2,
	}
)

Enum value maps for Order_PaymentMethod.

View Source
var (
	Order_Status_name = map[int32]string{
		0: "OPEN",
		1: "SENT",
		2: "COMPLETED",
	}
	Order_Status_value = map[string]int32{
		"OPEN":      0,
		"SENT":      1,
		"COMPLETED": 2,
	}
)

Enum value maps for Order_Status.

View Source
var (
	ListOrderConditions_Status_name = map[int32]string{
		0: "ANY",
		1: "OPEN",
		2: "SENT",
		3: "COMPLETED",
	}
	ListOrderConditions_Status_value = map[string]int32{
		"ANY":       0,
		"OPEN":      1,
		"SENT":      2,
		"COMPLETED": 3,
	}
)

Enum value maps for ListOrderConditions_Status.

Functions

func RegisterShopServer

func RegisterShopServer(s *grpc.Server, srv ShopServer)

Types

type Article

type Article struct {
	Id          int32                `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Created     *timestamp.Timestamp `protobuf:"bytes,2,opt,name=created,proto3" json:"created,omitempty"` // Read only
	Updated     *timestamp.Timestamp `protobuf:"bytes,3,opt,name=updated,proto3" json:"updated,omitempty"` // Read only
	Published   bool                 `protobuf:"varint,4,opt,name=published,proto3" json:"published,omitempty"`
	Title       string               `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"`
	Description string               `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"`
	Price       string               `protobuf:"bytes,7,opt,name=price,proto3" json:"price,omitempty"`
	Images      []*Media             `protobuf:"bytes,8,rep,name=images,proto3" json:"images,omitempty"`
	Videos      []*Media             `protobuf:"bytes,9,rep,name=videos,proto3" json:"videos,omitempty"`
	Token       string               `protobuf:"bytes,10,opt,name=token,proto3" json:"token,omitempty"` // Write only
	Promoted    bool                 `protobuf:"varint,11,opt,name=promoted,proto3" json:"promoted,omitempty"`
	Categories  []*Category          `protobuf:"bytes,12,rep,name=categories,proto3" json:"categories,omitempty"`
	Baseprices  []*BasePrice         `protobuf:"bytes,13,rep,name=baseprices,proto3" json:"baseprices,omitempty"`
	Variants    []*Variant           `protobuf:"bytes,14,rep,name=variants,proto3" json:"variants,omitempty"`
	// contains filtered or unexported fields
}

func (*Article) Descriptor deprecated

func (*Article) Descriptor() ([]byte, []int)

Deprecated: Use Article.ProtoReflect.Descriptor instead.

func (*Article) GetBaseprices added in v0.2.0

func (x *Article) GetBaseprices() []*BasePrice

func (*Article) GetCategories added in v0.1.1

func (x *Article) GetCategories() []*Category

func (*Article) GetCreated

func (x *Article) GetCreated() *timestamp.Timestamp

func (*Article) GetDescription

func (x *Article) GetDescription() string

func (*Article) GetId

func (x *Article) GetId() int32

func (*Article) GetImages

func (x *Article) GetImages() []*Media

func (*Article) GetPrice

func (x *Article) GetPrice() string

func (*Article) GetPromoted

func (x *Article) GetPromoted() bool

func (*Article) GetPublished

func (x *Article) GetPublished() bool

func (*Article) GetTitle

func (x *Article) GetTitle() string

func (*Article) GetToken

func (x *Article) GetToken() string

func (*Article) GetUpdated

func (x *Article) GetUpdated() *timestamp.Timestamp

func (*Article) GetVariants added in v0.2.0

func (x *Article) GetVariants() []*Variant

func (*Article) GetVideos

func (x *Article) GetVideos() []*Media

func (*Article) ProtoMessage

func (*Article) ProtoMessage()

func (*Article) ProtoReflect added in v0.4.1

func (x *Article) ProtoReflect() protoreflect.Message

func (*Article) Reset

func (x *Article) Reset()

func (*Article) String

func (x *Article) String() string

type ArticleFields added in v0.2.0

type ArticleFields int32

ArticleFields maps fields to database columns for requests.

const (
	ArticleFields_ALL         ArticleFields = 0
	ArticleFields_ID          ArticleFields = 1
	ArticleFields_CREATED     ArticleFields = 2
	ArticleFields_UPDATED     ArticleFields = 3
	ArticleFields_PUBLISHED   ArticleFields = 4
	ArticleFields_TITLE       ArticleFields = 5
	ArticleFields_DESCRIPTION ArticleFields = 6
	ArticleFields_PRICE       ArticleFields = 7
	ArticleFields_PROMOTED    ArticleFields = 11
)

func (ArticleFields) Descriptor added in v0.4.1

func (ArticleFields) Enum added in v0.4.1

func (x ArticleFields) Enum() *ArticleFields

func (ArticleFields) EnumDescriptor deprecated added in v0.2.0

func (ArticleFields) EnumDescriptor() ([]byte, []int)

Deprecated: Use ArticleFields.Descriptor instead.

func (ArticleFields) Number added in v0.4.1

func (ArticleFields) String added in v0.2.0

func (x ArticleFields) String() string

func (ArticleFields) Type added in v0.4.1

type ArticleID

type ArticleID struct {
	Id    int32  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` // Delete article requirement
	// contains filtered or unexported fields
}

func (*ArticleID) Descriptor deprecated

func (*ArticleID) Descriptor() ([]byte, []int)

Deprecated: Use ArticleID.ProtoReflect.Descriptor instead.

func (*ArticleID) GetId

func (x *ArticleID) GetId() int32

func (*ArticleID) GetToken added in v0.2.0

func (x *ArticleID) GetToken() string

func (*ArticleID) ProtoMessage

func (*ArticleID) ProtoMessage()

func (*ArticleID) ProtoReflect added in v0.4.1

func (x *ArticleID) ProtoReflect() protoreflect.Message

func (*ArticleID) Reset

func (x *ArticleID) Reset()

func (*ArticleID) String

func (x *ArticleID) String() string

type ArticleList

type ArticleList struct {
	List []*Article `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

func (*ArticleList) Descriptor deprecated

func (*ArticleList) Descriptor() ([]byte, []int)

Deprecated: Use ArticleList.ProtoReflect.Descriptor instead.

func (*ArticleList) GetList

func (x *ArticleList) GetList() []*Article

func (*ArticleList) ProtoMessage

func (*ArticleList) ProtoMessage()

func (*ArticleList) ProtoReflect added in v0.4.1

func (x *ArticleList) ProtoReflect() protoreflect.Message

func (*ArticleList) Reset

func (x *ArticleList) Reset()

func (*ArticleList) String

func (x *ArticleList) String() string

type ArticleRelations added in v0.2.0

type ArticleRelations struct {
	Images     []MediaFields     `protobuf:"varint,1,rep,packed,name=images,proto3,enum=shop.MediaFields" json:"images,omitempty"`
	Videos     []MediaFields     `protobuf:"varint,2,rep,packed,name=videos,proto3,enum=shop.MediaFields" json:"videos,omitempty"`
	Categories []CategoryFields  `protobuf:"varint,3,rep,packed,name=categories,proto3,enum=shop.CategoryFields" json:"categories,omitempty"`
	Baseprices []BasePriceFields `protobuf:"varint,4,rep,packed,name=baseprices,proto3,enum=shop.BasePriceFields" json:"baseprices,omitempty"`
	Variants   []VariantFields   `protobuf:"varint,5,rep,packed,name=variants,proto3,enum=shop.VariantFields" json:"variants,omitempty"`
	// contains filtered or unexported fields
}

ArticleRelations specify which relations should be loaded. Each relation in this message is an array of fields. So for each specified relation, the requested fields will be selected. Empty relations are not loaded. Use the *_ALL constant for a relation to return all available fields.

func (*ArticleRelations) Descriptor deprecated added in v0.2.0

func (*ArticleRelations) Descriptor() ([]byte, []int)

Deprecated: Use ArticleRelations.ProtoReflect.Descriptor instead.

func (*ArticleRelations) GetBaseprices added in v0.2.0

func (x *ArticleRelations) GetBaseprices() []BasePriceFields

func (*ArticleRelations) GetCategories added in v0.2.0

func (x *ArticleRelations) GetCategories() []CategoryFields

func (*ArticleRelations) GetImages added in v0.2.0

func (x *ArticleRelations) GetImages() []MediaFields

func (*ArticleRelations) GetVariants added in v0.2.0

func (x *ArticleRelations) GetVariants() []VariantFields

func (*ArticleRelations) GetVideos added in v0.2.0

func (x *ArticleRelations) GetVideos() []MediaFields

func (*ArticleRelations) ProtoMessage added in v0.2.0

func (*ArticleRelations) ProtoMessage()

func (*ArticleRelations) ProtoReflect added in v0.4.1

func (x *ArticleRelations) ProtoReflect() protoreflect.Message

func (*ArticleRelations) Reset added in v0.2.0

func (x *ArticleRelations) Reset()

func (*ArticleRelations) String added in v0.2.0

func (x *ArticleRelations) String() string

type BasePrice added in v0.2.0

type BasePrice struct {
	Id      int32                `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Created *timestamp.Timestamp `protobuf:"bytes,2,opt,name=created,proto3" json:"created,omitempty"` // Read only
	Updated *timestamp.Timestamp `protobuf:"bytes,3,opt,name=updated,proto3" json:"updated,omitempty"` // Read only
	Label   string               `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`
	Price   string               `protobuf:"bytes,5,opt,name=price,proto3" json:"price,omitempty"` // numeric
	Token   string               `protobuf:"bytes,6,opt,name=token,proto3" json:"token,omitempty"` // Admin write access requirement
	// contains filtered or unexported fields
}

BasePrice is an article's base price for dynamic calculation

func (*BasePrice) Descriptor deprecated added in v0.2.0

func (*BasePrice) Descriptor() ([]byte, []int)

Deprecated: Use BasePrice.ProtoReflect.Descriptor instead.

func (*BasePrice) GetCreated added in v0.2.0

func (x *BasePrice) GetCreated() *timestamp.Timestamp

func (*BasePrice) GetId added in v0.2.0

func (x *BasePrice) GetId() int32

func (*BasePrice) GetLabel added in v0.2.0

func (x *BasePrice) GetLabel() string

func (*BasePrice) GetPrice added in v0.2.0

func (x *BasePrice) GetPrice() string

func (*BasePrice) GetToken added in v0.2.0

func (x *BasePrice) GetToken() string

func (*BasePrice) GetUpdated added in v0.2.0

func (x *BasePrice) GetUpdated() *timestamp.Timestamp

func (*BasePrice) ProtoMessage added in v0.2.0

func (*BasePrice) ProtoMessage()

func (*BasePrice) ProtoReflect added in v0.4.1

func (x *BasePrice) ProtoReflect() protoreflect.Message

func (*BasePrice) Reset added in v0.2.0

func (x *BasePrice) Reset()

func (*BasePrice) String added in v0.2.0

func (x *BasePrice) String() string

type BasePriceFields added in v0.2.0

type BasePriceFields int32

BasePriceFields maps fields to database columns for requests.

const (
	BasePriceFields_BP_ALL     BasePriceFields = 0
	BasePriceFields_BP_ID      BasePriceFields = 1
	BasePriceFields_BP_CREATED BasePriceFields = 2
	BasePriceFields_BP_UPDATED BasePriceFields = 3
	BasePriceFields_BP_LABEL   BasePriceFields = 4
	BasePriceFields_BP_PRICE   BasePriceFields = 5
)

func (BasePriceFields) Descriptor added in v0.4.1

func (BasePriceFields) Enum added in v0.4.1

func (x BasePriceFields) Enum() *BasePriceFields

func (BasePriceFields) EnumDescriptor deprecated added in v0.2.0

func (BasePriceFields) EnumDescriptor() ([]byte, []int)

Deprecated: Use BasePriceFields.Descriptor instead.

func (BasePriceFields) Number added in v0.4.1

func (BasePriceFields) String added in v0.2.0

func (x BasePriceFields) String() string

func (BasePriceFields) Type added in v0.4.1

type BasePriceList added in v0.2.0

type BasePriceList struct {
	List []*BasePrice `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

func (*BasePriceList) Descriptor deprecated added in v0.2.0

func (*BasePriceList) Descriptor() ([]byte, []int)

Deprecated: Use BasePriceList.ProtoReflect.Descriptor instead.

func (*BasePriceList) GetList added in v0.2.0

func (x *BasePriceList) GetList() []*BasePrice

func (*BasePriceList) ProtoMessage added in v0.2.0

func (*BasePriceList) ProtoMessage()

func (*BasePriceList) ProtoReflect added in v0.4.1

func (x *BasePriceList) ProtoReflect() protoreflect.Message

func (*BasePriceList) Reset added in v0.2.0

func (x *BasePriceList) Reset()

func (*BasePriceList) String added in v0.2.0

func (x *BasePriceList) String() string

type BasePriceListCondtions added in v0.2.0

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

func (*BasePriceListCondtions) Descriptor deprecated added in v0.2.0

func (*BasePriceListCondtions) Descriptor() ([]byte, []int)

Deprecated: Use BasePriceListCondtions.ProtoReflect.Descriptor instead.

func (*BasePriceListCondtions) ProtoMessage added in v0.2.0

func (*BasePriceListCondtions) ProtoMessage()

func (*BasePriceListCondtions) ProtoReflect added in v0.4.1

func (x *BasePriceListCondtions) ProtoReflect() protoreflect.Message

func (*BasePriceListCondtions) Reset added in v0.2.0

func (x *BasePriceListCondtions) Reset()

func (*BasePriceListCondtions) String added in v0.2.0

func (x *BasePriceListCondtions) String() string

type Category added in v0.1.1

type Category struct {
	Id      int32                `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`          // Upsert identification, do not modify. Leave 0 for new categories.
	Created *timestamp.Timestamp `protobuf:"bytes,2,opt,name=created,proto3" json:"created,omitempty"` // Read only
	Updated *timestamp.Timestamp `protobuf:"bytes,3,opt,name=updated,proto3" json:"updated,omitempty"` // Read only
	Label   string               `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`
	// contains filtered or unexported fields
}

func (*Category) Descriptor deprecated added in v0.1.1

func (*Category) Descriptor() ([]byte, []int)

Deprecated: Use Category.ProtoReflect.Descriptor instead.

func (*Category) GetCreated added in v0.1.1

func (x *Category) GetCreated() *timestamp.Timestamp

func (*Category) GetId added in v0.1.1

func (x *Category) GetId() int32

func (*Category) GetLabel added in v0.1.1

func (x *Category) GetLabel() string

func (*Category) GetUpdated added in v0.1.1

func (x *Category) GetUpdated() *timestamp.Timestamp

func (*Category) ProtoMessage added in v0.1.1

func (*Category) ProtoMessage()

func (*Category) ProtoReflect added in v0.4.1

func (x *Category) ProtoReflect() protoreflect.Message

func (*Category) Reset added in v0.1.1

func (x *Category) Reset()

func (*Category) String added in v0.1.1

func (x *Category) String() string

type CategoryFields added in v0.2.0

type CategoryFields int32
const (
	CategoryFields_CAT_ALL     CategoryFields = 0
	CategoryFields_CAT_ID      CategoryFields = 1
	CategoryFields_CAT_CREATED CategoryFields = 2
	CategoryFields_CAT_UPDATED CategoryFields = 3
	CategoryFields_CAT_LABEL   CategoryFields = 4
)

func (CategoryFields) Descriptor added in v0.4.1

func (CategoryFields) Enum added in v0.4.1

func (x CategoryFields) Enum() *CategoryFields

func (CategoryFields) EnumDescriptor deprecated added in v0.2.0

func (CategoryFields) EnumDescriptor() ([]byte, []int)

Deprecated: Use CategoryFields.Descriptor instead.

func (CategoryFields) Number added in v0.4.1

func (CategoryFields) String added in v0.2.0

func (x CategoryFields) String() string

func (CategoryFields) Type added in v0.4.1

type CategoryList added in v0.1.1

type CategoryList struct {
	List  []*Category `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
	Token string      `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` // Admin write access requirement
	// contains filtered or unexported fields
}

CategoryList holds an ordered list of Categories.

func (*CategoryList) Descriptor deprecated added in v0.1.1

func (*CategoryList) Descriptor() ([]byte, []int)

Deprecated: Use CategoryList.ProtoReflect.Descriptor instead.

func (*CategoryList) GetList added in v0.1.1

func (x *CategoryList) GetList() []*Category

func (*CategoryList) GetToken added in v0.1.1

func (x *CategoryList) GetToken() string

func (*CategoryList) ProtoMessage added in v0.1.1

func (*CategoryList) ProtoMessage()

func (*CategoryList) ProtoReflect added in v0.4.1

func (x *CategoryList) ProtoReflect() protoreflect.Message

func (*CategoryList) Reset added in v0.1.1

func (x *CategoryList) Reset()

func (*CategoryList) String added in v0.1.1

func (x *CategoryList) String() string

type CategoryListConditions added in v0.1.1

type CategoryListConditions struct {
	OnlyPublishedArticles bool `` // Only return categories that have published articles.
	/* 127-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*CategoryListConditions) Descriptor deprecated added in v0.1.1

func (*CategoryListConditions) Descriptor() ([]byte, []int)

Deprecated: Use CategoryListConditions.ProtoReflect.Descriptor instead.

func (*CategoryListConditions) GetOnlyPublishedArticles added in v0.1.1

func (x *CategoryListConditions) GetOnlyPublishedArticles() bool

func (*CategoryListConditions) ProtoMessage added in v0.1.1

func (*CategoryListConditions) ProtoMessage()

func (*CategoryListConditions) ProtoReflect added in v0.4.1

func (x *CategoryListConditions) ProtoReflect() protoreflect.Message

func (*CategoryListConditions) Reset added in v0.1.1

func (x *CategoryListConditions) Reset()

func (*CategoryListConditions) String added in v0.1.1

func (x *CategoryListConditions) String() string

type Deleted

type Deleted struct {
	Rows int64 `protobuf:"varint,1,opt,name=rows,proto3" json:"rows,omitempty"`
	// contains filtered or unexported fields
}

func (*Deleted) Descriptor deprecated

func (*Deleted) Descriptor() ([]byte, []int)

Deprecated: Use Deleted.ProtoReflect.Descriptor instead.

func (*Deleted) GetRows

func (x *Deleted) GetRows() int64

func (*Deleted) ProtoMessage

func (*Deleted) ProtoMessage()

func (*Deleted) ProtoReflect added in v0.4.1

func (x *Deleted) ProtoReflect() protoreflect.Message

func (*Deleted) Reset

func (x *Deleted) Reset()

func (*Deleted) String

func (x *Deleted) String() string

type Details added in v0.2.0

type Details struct {
	BasePrice *BasePrice `protobuf:"bytes,1,opt,name=base_price,json=basePrice,proto3" json:"base_price,omitempty"`
	Variant   *Variant   `protobuf:"bytes,2,opt,name=variant,proto3" json:"variant,omitempty"`
	// contains filtered or unexported fields
}

func (*Details) Descriptor deprecated added in v0.2.0

func (*Details) Descriptor() ([]byte, []int)

Deprecated: Use Details.ProtoReflect.Descriptor instead.

func (*Details) GetBasePrice added in v0.2.0

func (x *Details) GetBasePrice() *BasePrice

func (*Details) GetVariant added in v0.2.0

func (x *Details) GetVariant() *Variant

func (*Details) ProtoMessage added in v0.2.0

func (*Details) ProtoMessage()

func (*Details) ProtoReflect added in v0.4.1

func (x *Details) ProtoReflect() protoreflect.Message

func (*Details) Reset added in v0.2.0

func (x *Details) Reset()

func (*Details) String added in v0.2.0

func (x *Details) String() string

type Limits added in v0.4.1

type Limits struct {
	Limit  int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
	Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

Limits sets limit and offset to any list query If the limit field is set to zero, the server can apply a default limit.

func (*Limits) Descriptor deprecated added in v0.4.1

func (*Limits) Descriptor() ([]byte, []int)

Deprecated: Use Limits.ProtoReflect.Descriptor instead.

func (*Limits) GetLimit added in v0.4.1

func (x *Limits) GetLimit() int32

func (*Limits) GetOffset added in v0.4.1

func (x *Limits) GetOffset() int32

func (*Limits) ProtoMessage added in v0.4.1

func (*Limits) ProtoMessage()

func (*Limits) ProtoReflect added in v0.4.1

func (x *Limits) ProtoReflect() protoreflect.Message

func (*Limits) Reset added in v0.4.1

func (x *Limits) Reset()

func (*Limits) String added in v0.4.1

func (x *Limits) String() string

type ListConditions

type ListConditions struct {
	OnlyPublished     bool              `protobuf:"varint,1,opt,name=only_published,json=onlyPublished,proto3" json:"only_published,omitempty"`
	OnlyPromoted      bool              `protobuf:"varint,2,opt,name=only_promoted,json=onlyPromoted,proto3" json:"only_promoted,omitempty"`
	OnlyCategoryId    int32             `protobuf:"varint,4,opt,name=only_category_id,json=onlyCategoryId,proto3" json:"only_category_id,omitempty"`
	OnlyCategoryLabel string            `protobuf:"bytes,5,opt,name=only_category_label,json=onlyCategoryLabel,proto3" json:"only_category_label,omitempty"`
	Fields            []ArticleFields   `protobuf:"varint,6,rep,packed,name=fields,proto3,enum=shop.ArticleFields" json:"fields,omitempty"` // Which columns to select. Empty selects all columns.
	Relations         *ArticleRelations `protobuf:"bytes,7,opt,name=relations,proto3" json:"relations,omitempty"`                           // Which relations to load. Empty will load only images.
	Limits            *Limits           `protobuf:"bytes,8,opt,name=limits,proto3" json:"limits,omitempty"`
	// contains filtered or unexported fields
}

ListConditions are the conditions against which the article list is filtered. The conitions are aplied as AND. For example:

&ListCondions{
   OnlyPublished: true,
   OnlyCategoryLabel: "foo",
}

Will result in articles that are published and have a category label of "foo".

Conditions are ignored when in their default value. Meaning articles with any state for that field is returned.

func (*ListConditions) Descriptor deprecated

func (*ListConditions) Descriptor() ([]byte, []int)

Deprecated: Use ListConditions.ProtoReflect.Descriptor instead.

func (*ListConditions) GetFields added in v0.2.0

func (x *ListConditions) GetFields() []ArticleFields

func (*ListConditions) GetLimits added in v0.4.1

func (x *ListConditions) GetLimits() *Limits

func (*ListConditions) GetOnlyCategoryId added in v0.1.1

func (x *ListConditions) GetOnlyCategoryId() int32

func (*ListConditions) GetOnlyCategoryLabel added in v0.1.1

func (x *ListConditions) GetOnlyCategoryLabel() string

func (*ListConditions) GetOnlyPromoted

func (x *ListConditions) GetOnlyPromoted() bool

func (*ListConditions) GetOnlyPublished

func (x *ListConditions) GetOnlyPublished() bool

func (*ListConditions) GetRelations added in v0.2.0

func (x *ListConditions) GetRelations() *ArticleRelations

func (*ListConditions) ProtoMessage

func (*ListConditions) ProtoMessage()

func (*ListConditions) ProtoReflect added in v0.4.1

func (x *ListConditions) ProtoReflect() protoreflect.Message

func (*ListConditions) Reset

func (x *ListConditions) Reset()

func (*ListConditions) String

func (x *ListConditions) String() string

type ListOrderConditions

type ListOrderConditions struct {
	Status ListOrderConditions_Status `protobuf:"varint,1,opt,name=status,proto3,enum=shop.ListOrderConditions_Status" json:"status,omitempty"`
	Token  string                     `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*ListOrderConditions) Descriptor deprecated

func (*ListOrderConditions) Descriptor() ([]byte, []int)

Deprecated: Use ListOrderConditions.ProtoReflect.Descriptor instead.

func (*ListOrderConditions) GetStatus

func (*ListOrderConditions) GetToken added in v0.2.0

func (x *ListOrderConditions) GetToken() string

func (*ListOrderConditions) ProtoMessage

func (*ListOrderConditions) ProtoMessage()

func (*ListOrderConditions) ProtoReflect added in v0.4.1

func (x *ListOrderConditions) ProtoReflect() protoreflect.Message

func (*ListOrderConditions) Reset

func (x *ListOrderConditions) Reset()

func (*ListOrderConditions) String

func (x *ListOrderConditions) String() string

type ListOrderConditions_Status

type ListOrderConditions_Status int32
const (
	ListOrderConditions_ANY       ListOrderConditions_Status = 0
	ListOrderConditions_OPEN      ListOrderConditions_Status = 1
	ListOrderConditions_SENT      ListOrderConditions_Status = 2
	ListOrderConditions_COMPLETED ListOrderConditions_Status = 3
)

func (ListOrderConditions_Status) Descriptor added in v0.4.1

func (ListOrderConditions_Status) Enum added in v0.4.1

func (ListOrderConditions_Status) EnumDescriptor deprecated

func (ListOrderConditions_Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use ListOrderConditions_Status.Descriptor instead.

func (ListOrderConditions_Status) Number added in v0.4.1

func (ListOrderConditions_Status) String

func (ListOrderConditions_Status) Type added in v0.4.1

type Media

type Media struct {
	Id    int32  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
	Url   string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
	// contains filtered or unexported fields
}

func (*Media) Descriptor deprecated

func (*Media) Descriptor() ([]byte, []int)

Deprecated: Use Media.ProtoReflect.Descriptor instead.

func (*Media) GetId

func (x *Media) GetId() int32

func (*Media) GetLabel

func (x *Media) GetLabel() string

func (*Media) GetUrl

func (x *Media) GetUrl() string

func (*Media) ProtoMessage

func (*Media) ProtoMessage()

func (*Media) ProtoReflect added in v0.4.1

func (x *Media) ProtoReflect() protoreflect.Message

func (*Media) Reset

func (x *Media) Reset()

func (*Media) String

func (x *Media) String() string

type MediaFields added in v0.2.0

type MediaFields int32

MediaFields maps fields to database columns for requests.

const (
	MediaFields_MD_ALL   MediaFields = 0
	MediaFields_MD_ID    MediaFields = 1
	MediaFields_MD_LABEL MediaFields = 2
	MediaFields_MD_URL   MediaFields = 3
)

func (MediaFields) Descriptor added in v0.4.1

func (MediaFields) Enum added in v0.4.1

func (x MediaFields) Enum() *MediaFields

func (MediaFields) EnumDescriptor deprecated added in v0.2.0

func (MediaFields) EnumDescriptor() ([]byte, []int)

Deprecated: Use MediaFields.Descriptor instead.

func (MediaFields) Number added in v0.4.1

func (x MediaFields) Number() protoreflect.EnumNumber

func (MediaFields) String added in v0.2.0

func (x MediaFields) String() string

func (MediaFields) Type added in v0.4.1

type Message added in v0.4.1

type Message struct {
	Id      int32  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`          // Read-only
	Name    string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`       // Required
	Email   string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`     // Required
	Phone   string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"`     // Optional
	Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // Optional
	Message string `protobuf:"bytes,6,opt,name=message,proto3" json:"message,omitempty"` // Required
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated added in v0.4.1

func (*Message) Descriptor() ([]byte, []int)

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetEmail added in v0.4.1

func (x *Message) GetEmail() string

func (*Message) GetId added in v0.4.1

func (x *Message) GetId() int32

func (*Message) GetMessage added in v0.4.1

func (x *Message) GetMessage() string

func (*Message) GetName added in v0.4.1

func (x *Message) GetName() string

func (*Message) GetPhone added in v0.4.1

func (x *Message) GetPhone() string

func (*Message) GetSubject added in v0.4.1

func (x *Message) GetSubject() string

func (*Message) ProtoMessage added in v0.4.1

func (*Message) ProtoMessage()

func (*Message) ProtoReflect added in v0.4.1

func (x *Message) ProtoReflect() protoreflect.Message

func (*Message) Reset added in v0.4.1

func (x *Message) Reset()

func (*Message) String added in v0.4.1

func (x *Message) String() string

type MessageID added in v0.4.1

type MessageID struct {
	Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageID) Descriptor deprecated added in v0.4.1

func (*MessageID) Descriptor() ([]byte, []int)

Deprecated: Use MessageID.ProtoReflect.Descriptor instead.

func (*MessageID) GetId added in v0.4.1

func (x *MessageID) GetId() int32

func (*MessageID) ProtoMessage added in v0.4.1

func (*MessageID) ProtoMessage()

func (*MessageID) ProtoReflect added in v0.4.1

func (x *MessageID) ProtoReflect() protoreflect.Message

func (*MessageID) Reset added in v0.4.1

func (x *MessageID) Reset()

func (*MessageID) String added in v0.4.1

func (x *MessageID) String() string

type Order

type Order struct {
	Id            int32                  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Created       *timestamp.Timestamp   `protobuf:"bytes,2,opt,name=created,proto3" json:"created,omitempty"` // Read only
	Updated       *timestamp.Timestamp   `protobuf:"bytes,3,opt,name=updated,proto3" json:"updated,omitempty"` // Read only
	FullName      string                 `protobuf:"bytes,4,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"`
	Email         string                 `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"`
	Phone         string                 `protobuf:"bytes,6,opt,name=phone,proto3" json:"phone,omitempty"`
	FullAddress   string                 `protobuf:"bytes,7,opt,name=full_address,json=fullAddress,proto3" json:"full_address,omitempty"`
	Message       string                 `protobuf:"bytes,8,opt,name=message,proto3" json:"message,omitempty"`
	PaymentMethod Order_PaymentMethod    ``                                                                                           /* 131-byte string literal not displayed */
	Status        Order_Status           `protobuf:"varint,10,opt,name=status,proto3,enum=shop.Order_Status" json:"status,omitempty"` // Admin write access only
	Articles      []*Order_ArticleAmount `protobuf:"bytes,11,rep,name=articles,proto3" json:"articles,omitempty"`
	Sum           string                 `protobuf:"bytes,12,opt,name=sum,proto3" json:"sum,omitempty"`     // Read Only; sum of all line totals
	Token         string                 `protobuf:"bytes,13,opt,name=token,proto3" json:"token,omitempty"` // Admin write access requirement
	// contains filtered or unexported fields
}

func (*Order) Descriptor deprecated

func (*Order) Descriptor() ([]byte, []int)

Deprecated: Use Order.ProtoReflect.Descriptor instead.

func (*Order) GetArticles

func (x *Order) GetArticles() []*Order_ArticleAmount

func (*Order) GetCreated

func (x *Order) GetCreated() *timestamp.Timestamp

func (*Order) GetEmail

func (x *Order) GetEmail() string

func (*Order) GetFullAddress

func (x *Order) GetFullAddress() string

func (*Order) GetFullName

func (x *Order) GetFullName() string

func (*Order) GetId

func (x *Order) GetId() int32

func (*Order) GetMessage

func (x *Order) GetMessage() string

func (*Order) GetPaymentMethod

func (x *Order) GetPaymentMethod() Order_PaymentMethod

func (*Order) GetPhone

func (x *Order) GetPhone() string

func (*Order) GetStatus

func (x *Order) GetStatus() Order_Status

func (*Order) GetSum

func (x *Order) GetSum() string

func (*Order) GetToken

func (x *Order) GetToken() string

func (*Order) GetUpdated

func (x *Order) GetUpdated() *timestamp.Timestamp

func (*Order) ProtoMessage

func (*Order) ProtoMessage()

func (*Order) ProtoReflect added in v0.4.1

func (x *Order) ProtoReflect() protoreflect.Message

func (*Order) Reset

func (x *Order) Reset()

func (*Order) String

func (x *Order) String() string

type OrderID

type OrderID struct {
	Id     int32  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	EnvKey string `protobuf:"bytes,2,opt,name=env_key,json=envKey,proto3" json:"env_key,omitempty"`
	Data   string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*OrderID) Descriptor deprecated

func (*OrderID) Descriptor() ([]byte, []int)

Deprecated: Use OrderID.ProtoReflect.Descriptor instead.

func (*OrderID) GetData added in v0.2.0

func (x *OrderID) GetData() string

func (*OrderID) GetEnvKey added in v0.2.0

func (x *OrderID) GetEnvKey() string

func (*OrderID) GetId

func (x *OrderID) GetId() int32

func (*OrderID) ProtoMessage

func (*OrderID) ProtoMessage()

func (*OrderID) ProtoReflect added in v0.4.1

func (x *OrderID) ProtoReflect() protoreflect.Message

func (*OrderID) Reset

func (x *OrderID) Reset()

func (*OrderID) String

func (x *OrderID) String() string

type OrderList

type OrderList struct {
	List []*Order `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

func (*OrderList) Descriptor deprecated

func (*OrderList) Descriptor() ([]byte, []int)

Deprecated: Use OrderList.ProtoReflect.Descriptor instead.

func (*OrderList) GetList

func (x *OrderList) GetList() []*Order

func (*OrderList) ProtoMessage

func (*OrderList) ProtoMessage()

func (*OrderList) ProtoReflect added in v0.4.1

func (x *OrderList) ProtoReflect() protoreflect.Message

func (*OrderList) Reset

func (x *OrderList) Reset()

func (*OrderList) String

func (x *OrderList) String() string

type Order_ArticleAmount

type Order_ArticleAmount struct {
	ArticleId   int32    `protobuf:"varint,1,opt,name=article_id,json=articleId,proto3" json:"article_id,omitempty"`
	Amount      int32    `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
	Title       string   `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`                                   // Read only
	Price       string   `protobuf:"bytes,4,opt,name=price,proto3" json:"price,omitempty"`                                   // Read only
	Total       string   `protobuf:"bytes,5,opt,name=total,proto3" json:"total,omitempty"`                                   // Read only; line total of Price*Amount
	Details     *Details `protobuf:"bytes,6,opt,name=details,proto3" json:"details,omitempty"`                               // Read only
	BasePriceId int32    `protobuf:"varint,7,opt,name=base_price_id,json=basePriceId,proto3" json:"base_price_id,omitempty"` // Checkout write only
	VariantId   int64    `protobuf:"varint,8,opt,name=variant_id,json=variantId,proto3" json:"variant_id,omitempty"`         // Checkout write only
	// contains filtered or unexported fields
}

func (*Order_ArticleAmount) Descriptor deprecated

func (*Order_ArticleAmount) Descriptor() ([]byte, []int)

Deprecated: Use Order_ArticleAmount.ProtoReflect.Descriptor instead.

func (*Order_ArticleAmount) GetAmount

func (x *Order_ArticleAmount) GetAmount() int32

func (*Order_ArticleAmount) GetArticleId

func (x *Order_ArticleAmount) GetArticleId() int32

func (*Order_ArticleAmount) GetBasePriceId added in v0.2.0

func (x *Order_ArticleAmount) GetBasePriceId() int32

func (*Order_ArticleAmount) GetDetails added in v0.1.1

func (x *Order_ArticleAmount) GetDetails() *Details

func (*Order_ArticleAmount) GetPrice

func (x *Order_ArticleAmount) GetPrice() string

func (*Order_ArticleAmount) GetTitle

func (x *Order_ArticleAmount) GetTitle() string

func (*Order_ArticleAmount) GetTotal

func (x *Order_ArticleAmount) GetTotal() string

func (*Order_ArticleAmount) GetVariantId added in v0.2.0

func (x *Order_ArticleAmount) GetVariantId() int64

func (*Order_ArticleAmount) ProtoMessage

func (*Order_ArticleAmount) ProtoMessage()

func (*Order_ArticleAmount) ProtoReflect added in v0.4.1

func (x *Order_ArticleAmount) ProtoReflect() protoreflect.Message

func (*Order_ArticleAmount) Reset

func (x *Order_ArticleAmount) Reset()

func (*Order_ArticleAmount) String

func (x *Order_ArticleAmount) String() string

type Order_PaymentMethod

type Order_PaymentMethod int32
const (
	Order_CASH_ON_DELIVERY Order_PaymentMethod = 0
	Order_BANK_TRANSFER    Order_PaymentMethod = 1
	Order_ONLINE           Order_PaymentMethod = 2 // Not yet implemented
)

func (Order_PaymentMethod) Descriptor added in v0.4.1

func (Order_PaymentMethod) Enum added in v0.4.1

func (Order_PaymentMethod) EnumDescriptor deprecated

func (Order_PaymentMethod) EnumDescriptor() ([]byte, []int)

Deprecated: Use Order_PaymentMethod.Descriptor instead.

func (Order_PaymentMethod) Number added in v0.4.1

func (Order_PaymentMethod) String

func (x Order_PaymentMethod) String() string

func (Order_PaymentMethod) Type added in v0.4.1

type Order_Status

type Order_Status int32
const (
	Order_OPEN      Order_Status = 0
	Order_SENT      Order_Status = 1
	Order_COMPLETED Order_Status = 2
)

func (Order_Status) Descriptor added in v0.4.1

func (Order_Status) Enum added in v0.4.1

func (x Order_Status) Enum() *Order_Status

func (Order_Status) EnumDescriptor deprecated

func (Order_Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use Order_Status.Descriptor instead.

func (Order_Status) Number added in v0.4.1

func (Order_Status) String

func (x Order_Status) String() string

func (Order_Status) Type added in v0.4.1

type ShopClient

type ShopClient interface {
	// SaveArticle updates an article identified by ID.
	// If ID is unset (0) a new article is insered.
	// On success the affected article ID is returned.
	SaveArticle(ctx context.Context, in *Article, opts ...grpc.CallOption) (*ArticleID, error)
	// ViewArticle identied by ID.
	ViewArticle(ctx context.Context, in *ArticleID, opts ...grpc.CallOption) (*Article, error)
	// ListArticles filtered by ListCondtions.
	ListArticles(ctx context.Context, in *ListConditions, opts ...grpc.CallOption) (*ArticleList, error)
	// DeleteArticle and all associated images and videos
	DeleteArticle(ctx context.Context, in *ArticleID, opts ...grpc.CallOption) (*Deleted, error)
	// Checkout an order of articles
	Checkout(ctx context.Context, in *Order, opts ...grpc.CallOption) (*OrderID, error)
	// ListOrders returns all orders
	ListOrders(ctx context.Context, in *ListOrderConditions, opts ...grpc.CallOption) (*OrderList, error)
	// SaveOrder updates the order identified by ID.
	// It is not (yet) possibile to change the articles on an order.
	SaveOrder(ctx context.Context, in *Order, opts ...grpc.CallOption) (*OrderID, error)
	// SaveCategories upserts the categories in the provided CategoryList.
	// Returned CategoryList is always in the same order as the provided one.
	//
	// New articles should have their ID field set to 0.
	// Those IDs will be populated in the reponse.
	// Existing categories should always keep the same ID
	// and is used for updates and re-sorting.
	SaveCategories(ctx context.Context, in *CategoryList, opts ...grpc.CallOption) (*CategoryList, error)
	// ListCategories returns all categories, filtered by CategoryListConditions.
	// Returned CategoryList is always in the same order as passed to SaveCategories.
	ListCategories(ctx context.Context, in *CategoryListConditions, opts ...grpc.CallOption) (*CategoryList, error)
	// SearchArticles returns ArticleList that matches TextSearch.value.
	SearchArticles(ctx context.Context, in *TextSearch, opts ...grpc.CallOption) (*ArticleList, error)
	// Suggest returns a list of matching articles and categories
	Suggest(ctx context.Context, in *TextSearch, opts ...grpc.CallOption) (*SuggestionList, error)
	// SaveBasePrice updates a base price identified by ID.
	// If ID is unset (0) a new base price is insered.
	// On success the affected base price is returned with its ID populated.
	SaveBasePrice(ctx context.Context, in *BasePrice, opts ...grpc.CallOption) (*BasePrice, error)
	// DeleteBasePrice dis-assosiates all articles and deleted the given BasePrice
	DeleteBasePrice(ctx context.Context, in *BasePrice, opts ...grpc.CallOption) (*Deleted, error)
	// ListBasePrices returns all base prices.
	ListBasesPrices(ctx context.Context, in *BasePriceListCondtions, opts ...grpc.CallOption) (*BasePriceList, error)
	// SendMessage sends an email message to the site admin
	SendMessage(ctx context.Context, in *Message, opts ...grpc.CallOption) (*MessageID, error)
}

ShopClient is the client API for Shop service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewShopClient

func NewShopClient(cc grpc.ClientConnInterface) ShopClient

type ShopServer

type ShopServer interface {
	// SaveArticle updates an article identified by ID.
	// If ID is unset (0) a new article is insered.
	// On success the affected article ID is returned.
	SaveArticle(context.Context, *Article) (*ArticleID, error)
	// ViewArticle identied by ID.
	ViewArticle(context.Context, *ArticleID) (*Article, error)
	// ListArticles filtered by ListCondtions.
	ListArticles(context.Context, *ListConditions) (*ArticleList, error)
	// DeleteArticle and all associated images and videos
	DeleteArticle(context.Context, *ArticleID) (*Deleted, error)
	// Checkout an order of articles
	Checkout(context.Context, *Order) (*OrderID, error)
	// ListOrders returns all orders
	ListOrders(context.Context, *ListOrderConditions) (*OrderList, error)
	// SaveOrder updates the order identified by ID.
	// It is not (yet) possibile to change the articles on an order.
	SaveOrder(context.Context, *Order) (*OrderID, error)
	// SaveCategories upserts the categories in the provided CategoryList.
	// Returned CategoryList is always in the same order as the provided one.
	//
	// New articles should have their ID field set to 0.
	// Those IDs will be populated in the reponse.
	// Existing categories should always keep the same ID
	// and is used for updates and re-sorting.
	SaveCategories(context.Context, *CategoryList) (*CategoryList, error)
	// ListCategories returns all categories, filtered by CategoryListConditions.
	// Returned CategoryList is always in the same order as passed to SaveCategories.
	ListCategories(context.Context, *CategoryListConditions) (*CategoryList, error)
	// SearchArticles returns ArticleList that matches TextSearch.value.
	SearchArticles(context.Context, *TextSearch) (*ArticleList, error)
	// Suggest returns a list of matching articles and categories
	Suggest(context.Context, *TextSearch) (*SuggestionList, error)
	// SaveBasePrice updates a base price identified by ID.
	// If ID is unset (0) a new base price is insered.
	// On success the affected base price is returned with its ID populated.
	SaveBasePrice(context.Context, *BasePrice) (*BasePrice, error)
	// DeleteBasePrice dis-assosiates all articles and deleted the given BasePrice
	DeleteBasePrice(context.Context, *BasePrice) (*Deleted, error)
	// ListBasePrices returns all base prices.
	ListBasesPrices(context.Context, *BasePriceListCondtions) (*BasePriceList, error)
	// SendMessage sends an email message to the site admin
	SendMessage(context.Context, *Message) (*MessageID, error)
}

ShopServer is the server API for Shop service.

type SuggestionList added in v0.2.0

type SuggestionList struct {
	Category []*Category `protobuf:"bytes,1,rep,name=Category,proto3" json:"Category,omitempty"`
	Article  []*Article  `protobuf:"bytes,2,rep,name=Article,proto3" json:"Article,omitempty"`
	// contains filtered or unexported fields
}

func (*SuggestionList) Descriptor deprecated added in v0.2.0

func (*SuggestionList) Descriptor() ([]byte, []int)

Deprecated: Use SuggestionList.ProtoReflect.Descriptor instead.

func (*SuggestionList) GetArticle added in v0.2.0

func (x *SuggestionList) GetArticle() []*Article

func (*SuggestionList) GetCategory added in v0.2.0

func (x *SuggestionList) GetCategory() []*Category

func (*SuggestionList) ProtoMessage added in v0.2.0

func (*SuggestionList) ProtoMessage()

func (*SuggestionList) ProtoReflect added in v0.4.1

func (x *SuggestionList) ProtoReflect() protoreflect.Message

func (*SuggestionList) Reset added in v0.2.0

func (x *SuggestionList) Reset()

func (*SuggestionList) String added in v0.2.0

func (x *SuggestionList) String() string

type TextSearch added in v0.2.0

type TextSearch struct {
	Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` // Search keyword
	// contains filtered or unexported fields
}

func (*TextSearch) Descriptor deprecated added in v0.2.0

func (*TextSearch) Descriptor() ([]byte, []int)

Deprecated: Use TextSearch.ProtoReflect.Descriptor instead.

func (*TextSearch) GetText added in v0.2.0

func (x *TextSearch) GetText() string

func (*TextSearch) ProtoMessage added in v0.2.0

func (*TextSearch) ProtoMessage()

func (*TextSearch) ProtoReflect added in v0.4.1

func (x *TextSearch) ProtoReflect() protoreflect.Message

func (*TextSearch) Reset added in v0.2.0

func (x *TextSearch) Reset()

func (*TextSearch) String added in v0.2.0

func (x *TextSearch) String() string

type UnimplementedShopServer

type UnimplementedShopServer struct {
}

UnimplementedShopServer can be embedded to have forward compatible implementations.

func (*UnimplementedShopServer) Checkout

func (*UnimplementedShopServer) DeleteArticle

func (*UnimplementedShopServer) DeleteBasePrice added in v0.2.0

func (*UnimplementedShopServer) ListArticles

func (*UnimplementedShopServer) ListBasesPrices added in v0.2.0

func (*UnimplementedShopServer) ListCategories added in v0.1.1

func (*UnimplementedShopServer) ListOrders

func (*UnimplementedShopServer) SaveArticle

func (*UnimplementedShopServer) SaveBasePrice added in v0.2.0

func (*UnimplementedShopServer) SaveCategories added in v0.1.1

func (*UnimplementedShopServer) SaveOrder

func (*UnimplementedShopServer) SearchArticles added in v0.2.0

func (*UnimplementedShopServer) SendMessage added in v0.4.1

func (*UnimplementedShopServer) Suggest added in v0.2.0

func (*UnimplementedShopServer) ViewArticle

type Variant added in v0.2.0

type Variant struct {
	Id      int64                `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Created *timestamp.Timestamp `protobuf:"bytes,2,opt,name=created,proto3" json:"created,omitempty"` // Read only
	Updated *timestamp.Timestamp `protobuf:"bytes,3,opt,name=updated,proto3" json:"updated,omitempty"` // Read only
	// Labels allow for multi-dimensional price variations.
	Labels     []string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty"`
	Multiplier string   `protobuf:"bytes,5,opt,name=multiplier,proto3" json:"multiplier,omitempty"` // numeric
	// contains filtered or unexported fields
}

Variant is a price variation to an article.

func (*Variant) Descriptor deprecated added in v0.2.0

func (*Variant) Descriptor() ([]byte, []int)

Deprecated: Use Variant.ProtoReflect.Descriptor instead.

func (*Variant) GetCreated added in v0.2.0

func (x *Variant) GetCreated() *timestamp.Timestamp

func (*Variant) GetId added in v0.2.0

func (x *Variant) GetId() int64

func (*Variant) GetLabels added in v0.2.0

func (x *Variant) GetLabels() []string

func (*Variant) GetMultiplier added in v0.2.0

func (x *Variant) GetMultiplier() string

func (*Variant) GetUpdated added in v0.2.0

func (x *Variant) GetUpdated() *timestamp.Timestamp

func (*Variant) ProtoMessage added in v0.2.0

func (*Variant) ProtoMessage()

func (*Variant) ProtoReflect added in v0.4.1

func (x *Variant) ProtoReflect() protoreflect.Message

func (*Variant) Reset added in v0.2.0

func (x *Variant) Reset()

func (*Variant) String added in v0.2.0

func (x *Variant) String() string

type VariantFields added in v0.2.0

type VariantFields int32

VariantFields maps fields to database columns for requests.

const (
	VariantFields_VRT_ALL        VariantFields = 0
	VariantFields_VRT_ID         VariantFields = 1
	VariantFields_VRT_CREATED    VariantFields = 2
	VariantFields_VRT_UPDATED    VariantFields = 3
	VariantFields_VRT_LABELS     VariantFields = 4
	VariantFields_VRT_MULTIPLIER VariantFields = 5
)

func (VariantFields) Descriptor added in v0.4.1

func (VariantFields) Enum added in v0.4.1

func (x VariantFields) Enum() *VariantFields

func (VariantFields) EnumDescriptor deprecated added in v0.2.0

func (VariantFields) EnumDescriptor() ([]byte, []int)

Deprecated: Use VariantFields.Descriptor instead.

func (VariantFields) Number added in v0.4.1

func (VariantFields) String added in v0.2.0

func (x VariantFields) String() string

func (VariantFields) Type added in v0.4.1

Directories

Path Synopsis
Package builder provides dynamic query building based on conditions.
Package builder provides dynamic query building based on conditions.
cmd
server command

Jump to

Keyboard shortcuts

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