types

package
v0.0.0-...-f46b403 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetProductRequest

type GetProductRequest struct {
	Id      string `json:"id"`
	Barcode string `json:"barcode"`
}

func GetProductRequestFromProto

func GetProductRequestFromProto(r *pb.GetProductRequest) *GetProductRequest

type GetProductResponse

type GetProductResponse struct {
	Product *Product `json:"store_product"`
}

func GetProductResponseFromProto

func GetProductResponseFromProto(r *pb.GetProductResponse) *GetProductResponse

func (*GetProductResponse) ToProto

type GetProductsRequest

type GetProductsRequest struct {
	DisplayName string      `json:"display_name"`
	Pagination  *Pagination `json:"pagination"`
}

func GetProductsRequestFromProto

func GetProductsRequestFromProto(r *pb.GetProductsRequest) *GetProductsRequest

func (*GetProductsRequest) ToProto

type GetProductsResponse

type GetProductsResponse struct {
	Products []*Product `json:"products"`
}

func GetProductsResponseFromProto

func GetProductsResponseFromProto(r *pb.GetProductsResponse) *GetProductsResponse

func (*GetProductsResponse) ToProto

type GetStoreProductRequest

type GetStoreProductRequest struct {
	Id string `json:"id"`
}

func GetStoreProductRequestFromProto

func GetStoreProductRequestFromProto(r *pb.GetStoreProductRequest) *GetStoreProductRequest

type GetStoreProductResponse

type GetStoreProductResponse struct {
	StoreProduct *StoreProduct `json:"store_product"`
}

func (*GetStoreProductResponse) ToProto

type GetStoreProductsRequest

type GetStoreProductsRequest struct {
	StoreId    string      `json:"store_id"`
	ProductId  string      `json:"product_id"`
	Quantity   int32       `json:"quantity"`
	Pagination *Pagination `json:"pagination"`
}

func (*GetStoreProductsRequest) ToProto

type GetStoreProductsResponse

type GetStoreProductsResponse struct {
	StoreProducts []*StoreProduct `json:"store_products"`
}

func (*GetStoreProductsResponse) ToProto

type GetStoreRequest

type GetStoreRequest struct {
	Id string `json:"id"`
}

func GetStoreRequestFromProto

func GetStoreRequestFromProto(r *pb.GetStoreRequest) *GetStoreRequest

type GetStoreResponse

type GetStoreResponse struct {
	Store *Store `json:"store"`
}

func GetStoreResponseFromProto

func GetStoreResponseFromProto(r *pb.GetStoreResponse) *GetStoreResponse

func (*GetStoreResponse) ToProto

func (r *GetStoreResponse) ToProto() *pb.GetStoreResponse

type GetStoresRequest

type GetStoresRequest struct {
	Location    *Location   `json:"location"`
	DisplayName string      `json:"display_name"`
	Pagination  *Pagination `json:"pagination"`
}

func GetStoresRequestFromProto

func GetStoresRequestFromProto(r *pb.GetStoresRequest) *GetStoresRequest

func (*GetStoresRequest) ToProto

func (r *GetStoresRequest) ToProto() *pb.GetStoresRequest

type GetStoresResponse

type GetStoresResponse struct {
	Stores []*Store `json:"stores"`
}

func GetStoresResponseFromProto

func GetStoresResponseFromProto(r *pb.GetStoresResponse) *GetStoresResponse

func (*GetStoresResponse) ToProto

func (r *GetStoresResponse) ToProto() *pb.GetStoresResponse

type Location

type Location struct {
	Address   string  `json:"address"`
	City      string  `json:"city"`
	ZipCode   string  `json:"zip_code"`
	Latitude  float32 `json:"latitude"`
	Longitude float32 `json:"longitude"`
}

func LocationFromProto

func LocationFromProto(l *pb.Location) *Location

func (*Location) ToProto

func (l *Location) ToProto() *pb.Location

type LoginResponse

type LoginResponse struct {
	User  *User  `json:"user"`
	Token string `json:"token"`
}

func LoginResponseFromProto

func LoginResponseFromProto(r *pb.LoginResponse) *LoginResponse

func (*LoginResponse) LoginResponseToProto

func (r *LoginResponse) LoginResponseToProto() *pb.LoginResponse

type Pagination

type Pagination struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

func PaginationFromProto

func PaginationFromProto(p *pb.Pagination) *Pagination

func (*Pagination) ToProto

func (p *Pagination) ToProto() *pb.Pagination

type Product

type Product struct {
	Id          string               `json:"id"`
	DisplayName string               `json:"display_name"`
	Barcode     string               `json:"barcode"`
	CreatedAt   *timestamp.Timestamp `json:"created_at"`
}

func ProductFromProto

func ProductFromProto(p *pb.Product) *Product

func (*Product) ToProto

func (p *Product) ToProto() *pb.Product

type Store

type Store struct {
	Id          string               `json:"id"`
	DisplayName string               `json:"display_name"`
	LogoUrl     string               `json:"logo_url"`
	CreatedAt   *timestamp.Timestamp `json:"created_at"`
	*Location
}

func StoreFromProto

func StoreFromProto(s *pb.Store) *Store

func (*Store) ToProto

func (s *Store) ToProto() *pb.Store

type StoreProduct

type StoreProduct struct {
	Id        string               `json:"id"`
	StoreId   string               `json:"store_id"`
	ProductId string               `json:"product_id"`
	Quantity  int32                `json:"quantity"`
	CreatedAt *timestamp.Timestamp `json:"created_at"`
}

func StoreProductFromProto

func StoreProductFromProto(p *pb.StoreProduct) *StoreProduct

func (*StoreProduct) ToProto

func (p *StoreProduct) ToProto() *pb.StoreProduct

type User

type User struct {
	Id          string
	Email       string `pg:",unique"`
	Verified    bool
	Username    string `pg:",unique"`
	DisplayName string
	Password    string
	CreatedAt   *timestamp.Timestamp
}

User represents a ryss user.

func UserFromProto

func UserFromProto(u *pb.User) *User

Converts a protobuf message, reprenting a ryss user, to a User struct.

func (*User) ToProto

func (u *User) ToProto() *pb.User

ToProto converts a protobuf user struct to an independent type definition.

type UserRepository

type UserRepository interface {
	GetUser(ctx context.Context, req *pb.GetUserRequest) (*User, error)
	StoreUser(ctx context.Context, user *User) error
}

type UserUsecase

type UserUsecase interface {
	GetUser(ctx context.Context, req *pb.GetUserRequest) (*User, error)
	StoreUser(ctx context.Context, user *User) error
}

Jump to

Keyboard shortcuts

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