Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrEntity1NotFound = errors.New("domain1: entity1 not found")
)
domain1 errors
Functions ¶
func NewHTTPTransport ¶
Types ¶
type Body ¶
type Body struct { ID string `json:"id"` Title string `json:"title"` DocDate string `json:"doc_date"` DocNumber string `json:"doc_number"` Ref string `json:"ref"` Total float32 `json:"total"` ImageURL string `json:"image_url"` AccessToken string `json:"access_token"` CreateDate string `json:"create_date"` Lines []Line `json:"lines"` }
type CreateRequest ¶
type CreateRequest struct { DocNumber string `json:"doc_number"` RefNumber string `json:"ref_number"` Title string `json:"title"` DocDate string `json:"doc_date"` SlipLines []Line AccessToken string `json:"access_token"` }
CreateRequest is the request for create endpoint
type CreateResponse ¶
CreateResponse is the response for create endpoint
type Database ¶
type Database interface { // Registers inserts given Entity1 into storage Insert(ctx context.Context, b *Body) (id string, err error) // SetField3 sets field3 for Entity1 FindByID(ctx context.Context, id string) (*Body, error) }
Database is the slip database interface
type Endpoint ¶
type Endpoint interface { Create(context.Context, *CreateRequest) (*CreateResponse, error) FindByID(context.Context, *FindByIDRequest) (*FindByIDResponse, error) }
Endpoint is the slip endpoint
type FindByIDRequest ¶
type FindByIDRequest struct {
ID string `json:"id"`
}
FindRequest is the request for find endpoint
type FindByIDResponse ¶
type FindByIDResponse struct {
URL string `json:"id"`
}
FindByIDRespose is the response for find by id endpoint
type Storage ¶
type Storage interface { StoreFile(ctx context.Context, fileName, objectName string) (url string, err error) StoreByte(ctx context.Context, b []byte, objectName string) (url string, err error) StoreOriginPNG(ctx context.Context, m image.Image, folderName string) (url string, err error) RemoveFile(ctx context.Context, objectName string) error }
Storage is the slip storage interface for save image file
Source Files ¶
Click to show internal directories.
Click to hide internal directories.