scoro

package module
v0.0.0-...-3a87049 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: LGPL-3.0 Imports: 9 Imported by: 0

README

go-scoro

GoDoc

go-scoro is an Go client library for Scoro API

Getting started
Installation

go get -u gopkg.in/packform/go-scoro.v1 or govendor fetch gopkg.in/packform/go-scoro.v1

Documentation

API documentation and examples are available via godoc.

If you need to check documentation locally before commit, run godoc -http ":6060" and open http://localhost:6060/pkg/github.com/packform/go-scoro/ in browser.

Examples

The examples directory contains more elaborate example applications.

go run examples/<path>/<file>.go -company <company_id> -api_key <api_key> -subdomain <subdomain>

Note:

The library does not have implementations of all Scoro resources. PRs for new resources and endpoints are welcome.

Documentation

Overview

Package scoro provides Go client code for sending requests to Scoro API.

Services

Code of the library is divided into several services, one for each Scoro API "module". Each service provides a subset of View/List/Modify/Delete actions which are directly mapped to the corresponding API calls.

Products service:

products := scoro.Products(credentials)

Quotes service:

quotes := scoro.Quotes(credentials)

Orders service:

orders := scoro.Orders(credentials)

Invoices service:

invoices := scoro.Invoices(credentials)

Index

Constants

View Source
const DatePattern = `"2006-01-02"`

DatePattern represents time format used in Scoro API requests and responses

View Source
const DefaultLang = "eng"
View Source
const NullStr = "null"
View Source
const TimePattern = `"2006-01-02 15:04:05"`

TimePattern represents time format used in Scoro API requests and responses

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Country      string `json:"country,omitempty"`
	County       string `json:"county,omitempty"`
	Municipality string `json:"municipality,omitempty"`
	City         string `json:"city,omitempty"`
	Street       string `json:"street,omitempty"`
	ZipCode      string `json:"zipcode,omitempty"`
}

type Bool

type Bool struct {
	Value bool `json:",inlline"`
}

Bool type provides the implementation of serialization boolean values into Scoro API format. True -> "1" and False -> "0" mappings are used to serialize boolean values to into request JSON. Both boolean and "0"/"1" values are supported in response.

func (Bool) MarshalJSON

func (t Bool) MarshalJSON() ([]byte, error)

func (*Bool) UnmarshalJSON

func (t *Bool) UnmarshalJSON(data []byte) error

type Contact

type Contact struct {
	ContactID      *int              `json:"contact_id,omitempty"`
	Name           string            `json:"name,omitempty"`
	Lastname       string            `json:"lastname,omitempty"`
	ContactType    string            `json:"contact_type,omitempty"`
	IdCode         string            `json:"id_code,omitempty"`
	BankAccount    string            `json:"bankaccount,omitempty"`
	Birthday       Date              `json:"birthday,omitempty"`
	Position       string            `json:"position,omitempty"`
	Comments       string            `json:"comments,omitempty"`
	Sex            string            `json:"sex,omitempty"`
	VatNo          string            `json:"vatno,omitempty"`
	Timezone       string            `json:"timezone,omitempty"`
	ManagerID      int               `json:"manager_id,omitempty"`
	IsSupplier     Bool              `json:"is_supplier,omitempty"`
	IsClient       Bool              `json:"is_client,omitempty"`
	ModifiedDate   Time              `json:"modified_date,omitempty"`
	Addresses      []Address         `json:"addresses,omitempty"`
	MeansOfContact MeansOfContact    `json:"means_of_contact,omitempty"`
	Tags           []string          `json:"tags,omitempty"`
	ReferenceNo    string            `json:"reference_no,omitempty"`
	CustomFields   map[string]string `json:"custom_fields,omitempty"`
	IsDeleted      Bool              `json:"is_deleted"`
}

Contact struct represents contacts data type of Scoro API. https://api.scoro.com/api/#contactsApiDocs

type ContactList

type ContactList []Contact

type ContactsAPI

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

ContactsAPI provides type safe wrappers for View/List/Modify/Delete actions of contacts API

func Contacts

func Contacts(credentials Credentials) ContactsAPI

func (ContactsAPI) Delete

func (t ContactsAPI) Delete(id int) error

func (ContactsAPI) List

func (t ContactsAPI) List(filter interface{}, page int, count int) (*ContactList, error)

func (ContactsAPI) Modify

func (t ContactsAPI) Modify(product Contact) (*Contact, error)

func (ContactsAPI) Request

func (t ContactsAPI) Request() Request

func (ContactsAPI) View

func (t ContactsAPI) View(id string) (*Contact, error)

type Credentials

type Credentials struct {
	// ApiKey holds apiKey value that is listed in Settings > External Connections > API.
	ApiKey string `json:"apiKey"`

	// CompanyID holds company_account_id value that is listed in Settings > External Connections > API.
	CompanyID string `json:"company_account_id"`

	// API subdomain
	Subdomain string `json:"-"`
}

Credentials holds authentication parameters used to identificate Scoro customer and authorize requested action.

type Date

type Date struct {
	time.Time `json:",inline"`
}

Date type provides the implementation of JSON date serialization into Scoro API format.

Notes

  • format is YYYY-MM-DD
  • null value is supported
  • "0000-00-00" is considered as null

func (Date) MarshalJSON

func (t Date) MarshalJSON() ([]byte, error)

func (*Date) UnmarshalJSON

func (t *Date) UnmarshalJSON(data []byte) error

type Decimal

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

Decimal is custom representation of decimal values to avoid using types from 3rd part libraries in exported methods.

func CopyDecimal

func CopyDecimal(val DecimalLike) Decimal

func NewDecimal

func NewDecimal(intPart int64, exponent int32) Decimal

func NewDecimalFromFloat

func NewDecimalFromFloat(val float64) Decimal

func (Decimal) Exponent

func (t Decimal) Exponent() int32

func (Decimal) IntPart

func (t Decimal) IntPart() int64

func (Decimal) MarshalJSON

func (t Decimal) MarshalJSON() ([]byte, error)

func (*Decimal) UnmarshalJSON

func (t *Decimal) UnmarshalJSON(data []byte) error

type DecimalLike

type DecimalLike interface {
	IntPart() int64
	Exponent() int32
}

DecimalLike is interface for numeric values that can be represented as decimal

type Invoice

type Invoice struct {
	Id                       *int              `json:"id,omitempty"`
	PaymentType              string            `json:"payment_type,omitempty"`
	Fine                     string            `json:"fine,omitempty"`
	QuoteID                  int               `json:"quote_id"`
	OrderID                  int               `json:"order_id"`
	PrepaymentPercent        float32           `json:"prepayment_percent,omitempty"`
	PrepaymentSum            Decimal           `json:"prepayment_sum,omitempty"`
	ReferenceNo              string            `json:"reference_no,omitempty"`
	No                       string            `json:"no,omitempty"`
	Discount                 float32           `json:"discount,omitempty"`
	Discount2                float32           `json:"discount2,omitempty"`
	Discount3                float32           `json:"discount3,omitempty"`
	Sum                      Decimal           `json:"sum,omitempty"`
	VatSum                   Decimal           `json:"vat_sum,omitempty"`
	Vat                      Decimal           `json:"vat,omitempty"`
	CompanyID                int               `json:"company_id,omitempty"`
	PersonID                 int               `json:"person_id,omitempty"`
	CompanyAddressID         int               `json:"company_address_id,omitempty"`
	InterestedPartyID        int               `json:"interested_party_id,omitempty"`
	InterestedPartyAddressID int               `json:"interested_party_address_id,omitempty"`
	ProjectID                int               `json:"project_id,omitempty"`
	Currency                 string            `json:"currency,omitempty"`
	OwnerID                  int               `json:"owner_id,omitempty"`
	Date                     Date              `json:"date,omitempty"`
	Deadline                 Date              `json:"deadline,omitempty"`
	Status                   string            `json:"status,omitempty"`
	Description              string            `json:"description,omitempty"`
	IsSent                   Bool              `json:"is_sent"`
	Lines                    []InvoiceLine     `json:"lines,omitempty"`
	ModifiedDate             Time              `json:"modified_date,omitempty"`
	CustomFields             map[string]string `json:"custom_fields,omitempty"`
	IsDeleted                Bool              `json:"is_deleted"`
	DeletedDate              Time              `json:"deleted_date,omitempty"`
}

Invoice struct represents invoices data type of Scoro API. https://api.scoro.com/api/#invoicesApiDocs

type InvoiceLine

type InvoiceLine struct {
	Id              int               `json:"id"`
	ProductID       int               `json:"product_id"`
	Comment         string            `json:"comment"`
	Comment2        string            `json:"comment2"`
	UnitPrice       Decimal           `json:"price"`
	Amount          Decimal           `json:"amount"`
	Amount2         Decimal           `json:"amount2"`
	Discount        Decimal           `json:"discount"`
	Sum             Decimal           `json:"sum"`
	Vat             Decimal           `json:"vat"`
	Unit            string            `json:"unit"`
	FinanceObjectID int               `json:"finance_object_id"`
	Cost            Decimal           `json:"cost"`
	ProjectID       int               `json:"project_id"`
	CustomFields    map[string]string `json:"custom_fields,omitempty"`
}

InvoiceLine struct represents invoice lines data type of Scoro API. https://api.scoro.com/api/#invoiceLinesApiDocs

type InvoiceList

type InvoiceList []Invoice

type InvoicesAPI

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

InvoicesAPI provides type safe wrappers for View/List/Modify/Delete actions of invoices API

func Invoices

func Invoices(credentials Credentials) InvoicesAPI

InvoicesAPI provides type safe wrappers for View/List/Modify/Delete actions of invoices API

func PrepaymentInvoices

func PrepaymentInvoices(credentials Credentials) InvoicesAPI

InvoicesAPI provides type safe wrappers for View/List/Modify/Delete actions of prepayments API https://api.scoro.com/api/#prepaymentsApiDocs

func (InvoicesAPI) Delete

func (t InvoicesAPI) Delete(id int) error

func (InvoicesAPI) List

func (t InvoicesAPI) List(filter interface{}, page int, count int) (*InvoiceList, error)

func (InvoicesAPI) Modify

func (t InvoicesAPI) Modify(product Invoice) (*Invoice, error)

func (InvoicesAPI) Request

func (t InvoicesAPI) Request() Request

func (InvoicesAPI) View

func (t InvoicesAPI) View(id string) (*Invoice, error)

type MeansOfContact

type MeansOfContact struct {
	Mobiles  []string `json:"mobile,omitempty"`
	Phones   []string `json:"phone,omitempty"`
	Emails   []string `json:"email,omitempty"`
	Websites []string `json:"website,omitempty"`
	Skypes   []string `json:"skype,omitempty"`
	Faxes    []string `json:"fax,omitempty"`
}

type Order

type Order struct {
	Id                       *int              `json:"id,omitempty"`
	QuoteID                  int               `json:"quote_id"`
	No                       string            `json:"no,omitempty"`
	Discount                 float32           `json:"discount,omitempty"`
	Discount2                float32           `json:"discount2,omitempty"`
	Discount3                float32           `json:"discount3,omitempty"`
	Sum                      Decimal           `json:"sum,omitempty"`
	VatSum                   Decimal           `json:"vat_sum,omitempty"`
	Vat                      Decimal           `json:"vat,omitempty"`
	CompanyID                int               `json:"company_id,omitempty"`
	PersonID                 int               `json:"person_id,omitempty"`
	CompanyAddressID         int               `json:"company_address_id,omitempty"`
	InterestedPartyID        int               `json:"interested_party_id,omitempty"`
	InterestedPartyAddressID int               `json:"interested_party_address_id,omitempty"`
	ProjectID                int               `json:"project_id,omitempty"`
	Currency                 string            `json:"currency,omitempty"`
	OwnerID                  int               `json:"owner_id,omitempty"`
	Date                     Date              `json:"date,omitempty"`
	Deadline                 Date              `json:"deadline,omitempty"`
	Status                   string            `json:"status,omitempty"`
	Description              string            `json:"description,omitempty"`
	IsSent                   Bool              `json:"is_sent"`
	Lines                    []OrderLine       `json:"lines,omitempty"`
	ModifiedDate             Time              `json:"modified_date,omitempty"`
	CustomFields             map[string]string `json:"custom_fields,omitempty"`
	IsDeleted                Bool              `json:"is_deleted"`
	DeletedDate              Time              `json:"deleted_date,omitempty"`
}

Order struct represents orders data type of Scoro API. https://api.scoro.com/api/#ordersApiDocs

type OrderLine

type OrderLine struct {
	Id              int               `json:"id"`
	ProductID       int               `json:"product_id"`
	Comment         string            `json:"comment"`
	Comment2        string            `json:"comment2"`
	UnitPrice       Decimal           `json:"price"`
	Amount          Decimal           `json:"amount"`
	Amount2         Decimal           `json:"amount2"`
	Discount        Decimal           `json:"discount"`
	Sum             Decimal           `json:"sum"`
	Vat             Decimal           `json:"vat"`
	Unit            string            `json:"unit"`
	FinanceObjectID int               `json:"finance_object_id"`
	Cost            Decimal           `json:"cost"`
	ProjectID       int               `json:"project_id"`
	CustomFields    map[string]string `json:"custom_fields,omitempty"`
}

OrderLine struct represents order lines data type of Scoro API. https://api.scoro.com/api/#orderLinesApiDocs

type OrderList

type OrderList []Order

type OrdersAPI

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

OrdersAPI provides type safe wrappers for View/List/Modify/Delete actions of orders API

func Orders

func Orders(credentials Credentials) OrdersAPI

func (OrdersAPI) Delete

func (t OrdersAPI) Delete(id int) error

func (OrdersAPI) List

func (t OrdersAPI) List(filter interface{}, page int, count int) (*OrderList, error)

func (OrdersAPI) Modify

func (t OrdersAPI) Modify(product Order) (*Order, error)

func (OrdersAPI) Request

func (t OrdersAPI) Request() Request

func (OrdersAPI) View

func (t OrdersAPI) View(id string) (*Order, error)

type Product

type Product struct {
	Id                *int              `json:"product_id,omitempty"`
	Code              string            `json:"code,omitempty"`
	Name              string            `json:"name,omitempty"`
	Names             Strings           `json:"names,omitempty"`
	Price             Decimal           `json:"price,omitempty"`
	BuyingPrice       Decimal           `json:"buying_price,omitempty"`
	Description       Strings           `json:"description,omitempty"`
	Description2      Strings           `json:"description2,omitempty"`
	Tag               string            `json:"tag,omitempty"`
	Url               string            `json:"url,omitempty"`
	SupplierID        int               `json:"supplier_id,omitempty"`
	ProductGroupID    int               `json:"productgroup_id,omitempty"`
	IsActive          Bool              `json:"is_active"`
	IsService         Bool              `json:"is_service"`
	DefaultVatCodeID  int               `json:"default_vat_code_id,omitempty"`
	AccountinObjectID int               `json:"accounting_object_id,omitempty"`
	ModifiedDate      Time              `json:"modified_date,omitempty"`
	CustomFields      map[string]string `json:"custom_fields,omitempty"`
	IsDeleted         Bool              `json:"is_deleted"`
	DeletedDate       Time              `json:"deleted_date,omitempty"`
}

Product struct represents products data type of Scoro API. https://api.scoro.com/api/#productsApiDocs

type ProductList

type ProductList []Product

type ProductsAPI

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

ProductsAPI provides type safe wrappers for View/List/Modify/Delete actions of products API

func Products

func Products(credentials Credentials) ProductsAPI

func (ProductsAPI) Delete

func (t ProductsAPI) Delete(id int) error

func (ProductsAPI) List

func (t ProductsAPI) List(filter interface{}, page int, count int) (*ProductList, error)

func (ProductsAPI) Modify

func (t ProductsAPI) Modify(product Product) (*Product, error)

func (ProductsAPI) Request

func (t ProductsAPI) Request() Request

func (ProductsAPI) View

func (t ProductsAPI) View(id string) (*Product, error)

type Quote

type Quote struct {
	Id                       *int              `json:"id,omitempty"`
	No                       string            `json:"no,omitempty"`
	Discount                 float32           `json:"discount,omitempty"`
	Discount2                float32           `json:"discount2,omitempty"`
	Discount3                float32           `json:"discount3,omitempty"`
	Sum                      Decimal           `json:"sum,omitempty"`
	VatSum                   Decimal           `json:"vat_sum,omitempty"`
	Vat                      Decimal           `json:"vat,omitempty"`
	CompanyID                int               `json:"company_id,omitempty"`
	PersonID                 int               `json:"person_id,omitempty"`
	CompanyAddressID         int               `json:"company_address_id,omitempty"`
	InterestedPartyID        int               `json:"interested_party_id,omitempty"`
	InterestedPartyAddressID int               `json:"interested_party_address_id,omitempty"`
	ProjectID                int               `json:"project_id,omitempty"`
	Currency                 string            `json:"currency,omitempty"`
	OwnerID                  int               `json:"owner_id,omitempty"`
	Date                     Date              `json:"date,omitempty"`
	Deadline                 Date              `json:"deadline,omitempty"`
	Status                   string            `json:"status,omitempty"`
	Description              string            `json:"description,omitempty"`
	IsSent                   Bool              `json:"is_sent"`
	AccountID                string            `json:"account_id,omitempty"`
	Lines                    []QuoteLine       `json:"lines,omitempty"`
	ModifiedDate             Time              `json:"modified_date,omitempty"`
	CustomFields             map[string]string `json:"custom_fields,omitempty"`
	IsDeleted                Bool              `json:"is_deleted"`
	DeletedDate              Time              `json:"deleted_date,omitempty"`
}

Quote struct represents quotes data type of Scoro API. https://api.scoro.com/api/#quotesApiDocs

type QuoteLine

type QuoteLine struct {
	Id              int               `json:"id"`
	ProductID       int               `json:"product_id"`
	Comment         string            `json:"comment"`
	Comment2        string            `json:"comment2"`
	UnitPrice       Decimal           `json:"price"`
	Amount          Decimal           `json:"amount"`
	Amount2         Decimal           `json:"amount2"`
	Discount        Decimal           `json:"discount"`
	Sum             Decimal           `json:"sum"`
	Vat             Decimal           `json:"vat"`
	Unit            string            `json:"unit"`
	FinanceObjectID int               `json:"finance_object_id"`
	Cost            Decimal           `json:"cost"`
	ProjectID       int               `json:"project_id"`
	CustomFields    map[string]string `json:"custom_fields,omitempty"`
}

QuoteLine struct represents quote lines data type of Scoro API. https://api.scoro.com/api/#quoteLinesApiDocs

type QuoteList

type QuoteList []Quote

type QuotesAPI

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

QuotesAPI provides type safe wrappers for View/List/Modify/Delete actions of quotes API

func Quotes

func Quotes(credentials Credentials) QuotesAPI

func (QuotesAPI) Delete

func (t QuotesAPI) Delete(id int) error

func (QuotesAPI) List

func (t QuotesAPI) List(filter interface{}, page int, count int) (*QuoteList, error)

func (QuotesAPI) Modify

func (t QuotesAPI) Modify(product Quote) (*Quote, error)

func (QuotesAPI) Request

func (t QuotesAPI) Request() Request

func (QuotesAPI) View

func (t QuotesAPI) View(id string) (*Quote, error)

type Receipt

type Receipt struct {
	Id           *int    `json:"receipt_id,omitempty"`
	Date         Date    `json:"date,omitempty"`
	InvoiceID    *int    `json:"invoice_id,omitempty"`
	PrepaymentID *int    `json:"prepayment_id,omitempty"`
	Sum          Decimal `json:"sum,omitempty"`
	SalesDocType string  `json:"sales_doc_type,omitempty"`
	ContactID    int     `json:"contact_id,omitempty"`
	ContactName  string  `json:"contact_name,omitempty"`
}

Receipt struct represents receipts data type of Scoro API. https://api.scoro.com/api/#receiptsApiDocs

type ReceiptList

type ReceiptList []Receipt

type ReceiptsAPI

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

ReceiptsAPI provides type safe wrappers for View/List/Modify/Delete actions of receipts API

func Receipts

func Receipts(credentials Credentials) ReceiptsAPI

func (ReceiptsAPI) Delete

func (t ReceiptsAPI) Delete(id int) error

func (ReceiptsAPI) List

func (t ReceiptsAPI) List(filter interface{}, page int, count int) (*ReceiptList, error)

func (ReceiptsAPI) Modify

func (t ReceiptsAPI) Modify(receipt Receipt) (*Receipt, error)

func (ReceiptsAPI) Request

func (t ReceiptsAPI) Request() Request

func (ReceiptsAPI) View

func (t ReceiptsAPI) View(id string) (*Receipt, error)

type Relation

type Relation struct {
	ObjectID int `json:"object_id,omitempty"`

	// RelatedObjects is map containing related objects ID-s for each type on
	// list request and list of ID-s on modify/delete request.
	RelatedObjects interface{} `json:"related_objects,omitempty"`
	Type           string      `json:"type,omitempty"`
}

Relation struct represents relations data type of Scoro API. https://api.scoro.com/api/#relationsApiDocs

type RelationList

type RelationList []Relation

type RelationsAPI

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

RelationsAPI provides type safe wrappers for View/List/Modify/Delete actions of relations API

func Relations

func Relations(credentials Credentials) RelationsAPI

func (RelationsAPI) Delete

func (t RelationsAPI) Delete(id int) error

func (RelationsAPI) List

func (t RelationsAPI) List(filter interface{}, page int, count int) (*RelationList, error)

func (RelationsAPI) Modify

func (t RelationsAPI) Modify(relation Relation) (*Relation, error)

func (RelationsAPI) Request

func (t RelationsAPI) Request() Request

type Request

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

Request helps to build and send custom request to Scoro API. It supports automatic mappings of data structures into request body and from response.

It is unlikely that you will need to use this type directly. Most of the time service wrappers should be used instead. But it could be helpful in some case, for instance, if some new request isn't implemented yet.

Example:

response := NewRequest(credentials).SetResponse(ProductResponse{}).View(id)

func NewRequest

func NewRequest(credentials Credentials, entityType string) Request

NewRequest creates request object configured with specified credentials and pointed to the endpoint corresponding to the specified entityType.

entityType can be "products", "orders", "invoices" or any other type supported by Scoro API

func (Request) Delete

func (t Request) Delete(id int, filter interface{}) (interface{}, error)

Delete method sends "delete" action request

func (Request) List

func (t Request) List(filter interface{}, page int, count int) (interface{}, error)

List method sends "list" action request

func (Request) Modify

func (t Request) Modify(obj interface{}) (interface{}, error)

Modify method sends "modify" action request

func (Request) SetResponse

func (t Request) SetResponse(response ResponseType) Request

SetResponse method is to register the response object for automatic unmarshalling of JSON responses. Response type shoul conforms to the ResponseType interface.

request.SetResult(ProductResponse{})

Accessing a result value

if resp, err := request.View(id); err != nil {
	product := resp.(*productResponse).Product
}

func (Request) View

func (t Request) View(id string) (interface{}, error)

View method sends "view" action request

type ResponseHeader

type ResponseHeader struct {
	Status     string `json:"status"`
	StatusCode string `json:"statusCode"`
	Messages   *struct {
		Error []string `json:"error"`
	} `json:"messages,omitempty"`
}

ResponseHeader represents base part of API response that is common for all responses.

Example of defining new response type:

	type SomeNewResponse{
		RequestHeader `json:",inline"`
		Data 					SomeDataType `json:"data,omitempty"`
 	}

type ResponseType

type ResponseType interface {
	GetResponseHeader() ResponseHeader
}

ResponseType interface provides methods for retrieving information common for all responses. Each response type must implement this interface in order to be compatible with Request type.

type Strings

type Strings struct {
	Values map[string]string `json:",inline"`
}

Strings provides support for string fields with localization support. Scoro expects strings as localied dictionaries for some fields in request. However, it can return them as localized dictionary as single string (in requested lang) for the same fields in response. Marshal/Unmarshal implementations for this type handle both cases appropriately.

Examples:

field := scoro.MakeStrings("Some string", scoro.DefaultLang)
field := scoro.MakeStrings("Привет", "rus")

func MakeStrings

func MakeStrings(str string, lang string) Strings

MakeStrings is helper method that creates strings for single language, it can be convinient if you don't need localization for multiple languages.

func (Strings) MarshalJSON

func (t Strings) MarshalJSON() ([]byte, error)

func (*Strings) UnmarshalJSON

func (t *Strings) UnmarshalJSON(data []byte) error

type Time

type Time struct {
	time.Time `json:",inline"`
}

Time type provides the implementation of JSON date/time serialization into Scoro API format.

Notes

  • format is YYYY-MM-DD hh:mm:ss
  • null value is supported
  • "0000-00-00 00:00:00" is considered as null

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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