Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (c Client) Account() (models.Account, error)
- func (c Client) BankAccounts() ([]models.BankAccount, error)
- func (c Client) CreateInvoice(Invoice models.Invoice) (models.Invoice, error)
- func (c Client) CreateSubject(subject models.Subject) (models.Subject, error)
- func (c Client) DeleteInvoice(Id int) (bool, error)
- func (c *Client) EndpointURL() *url.URL
- func (c Client) InvoiceEvent(Id int, Event *models.InvoiceEvent) (bool, error)
- func (c Client) Invoices(invoiceFilters InvoiceFilter) ([]models.Invoice, error)
- func (c Client) InvoicesSearch(query string) ([]models.Invoice, error)
- func (c Client) Subjects() ([]models.Subject, error)
- func (c Client) SubjectsSearch(query string) ([]models.Subject, error)
- func (c Client) UpdateInvoice(Invoice models.Invoice, Id int) (models.Invoice, error)
- type Credentials
- type ErrorResponse
- type InvoiceFilter
- type Options
- type Value
Constants ¶
View Source
const ( InvoiceQuerySince = "since" InvoiceQueryUntil = "until" InvoiceQueryUpdatedSince = "updated_since" InvoiceQueryUpdatedUntil = "updated_until" InvoiceQueryNumber = "number" InvoiceQueryStatus = "status" InvoiceQueryInvoiceId = "invoice_id" InvoiceQueryCustomId = "custom_id" InvoiceQuerySubjectId = "subject_id" )
View Source
const BasicUrl = "https://app.fakturoid.cz/api/v2/accounts/"
Variables ¶
View Source
var DefaultTransport = func() (*http.Transport, error) { tr := &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, }).DialContext, MaxIdleConns: 256, MaxIdleConnsPerHost: 16, ResponseHeaderTimeout: time.Minute, IdleConnTimeout: time.Minute, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 10 * time.Second, DisableCompression: true, } tr.TLSClientConfig = &tls.Config{ MinVersion: tls.VersionTLS12, } return tr, nil }
DefaultTransport - this default transport is similar to http.DefaultTransport but with additional param DisableCompression is set to true to avoid decompressing content with 'gzip' encoding.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) BankAccounts ¶
func (c Client) BankAccounts() ([]models.BankAccount, error)
request on /bank_accounts.json
func (Client) CreateInvoice ¶
create Invoice on /invoices.json
func (Client) CreateSubject ¶
create subject on /subjects.json
func (Client) DeleteInvoice ¶ added in v0.0.3
delete Invoice on /invoices/{ID}.json
func (*Client) EndpointURL ¶
EndpointURL returns the URL of the fakturoid.
func (Client) InvoiceEvent ¶ added in v0.0.3
delete Invoice on /invoices/{ID}.json
func (Client) Invoices ¶
func (c Client) Invoices(invoiceFilters InvoiceFilter) ([]models.Invoice, error)
request on /invoices.json TODO paging
func (Client) InvoicesSearch ¶
request on /Invoices/search.json?query=
func (Client) SubjectsSearch ¶
request on /subjects/search.json?query=
type Credentials ¶
func NewCredentials ¶
func NewCredentials(email string, slug string, key string) *Credentials
type ErrorResponse ¶
TODO refine
func ToErrorResponse ¶
func ToErrorResponse(err error) ErrorResponse
type InvoiceFilter ¶
type InvoiceFilter struct { Since *time.Time Until *time.Time UpdatedSince *time.Time UpdatedUntil *time.Time Number string Status string InvoiceId int SubjectId int CustomId string }
structure to help filter invoices
func InvoiceFilterFromSubject ¶
func InvoiceFilterFromSubject(subject models.Subject) InvoiceFilter
type Options ¶
type Options struct { Transport http.RoundTripper Creds *Credentials }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.