briq

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

README

Briq Client

Golang client for briq

Briq API documentation

Example

Example here

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultPage  = 1
	DefaultLimit = 100
)
View Source
var BaseURL = "https://api.givebriq.com/v0"
View Source
var (
	Client = http.Client{
		Timeout: 10 * time.Second,
	}
)

Functions

This section is empty.

Types

type Briq

type Briq struct {
	Key         string
	AccessToken string
}

func NewBriq

func NewBriq(organizationKey, apiKey string) Briq

func (Briq) DoTransaction

func (b Briq) DoTransaction(t TransactionInput) TransactionResponse

func (Briq) Transactions

func (b Briq) Transactions(p Pagination) TransactionsResponse

func (Briq) Users

func (b Briq) Users(p Pagination) UsersResponse
type Link struct {
	First    *Pagination
	Last     *Pagination
	Previous *Pagination
	Next     *Pagination
}

func (Link) HasNext

func (l Link) HasNext() bool

func (Link) HasPrevious

func (l Link) HasPrevious() bool

type Organization

type Organization struct {
	ID        string `json:"id"`
	Key       string `json:"key"`
	CreatedAt string `json:"created_at"`
}

type Pagination

type Pagination struct {
	Page    int
	PerPage int
}

func Page

func Page(i ...int) Pagination

type Response

type Response struct {
	Error error
	Page  *Link
}

type Transaction

type Transaction struct {
	ID             string `json:"id"`
	From           string `json:"from"`
	To             string `json:"to"`
	Amount         int    `json:"amount"`
	App            string `json:"app"`
	Comment        string `json:"comment"`
	Reaction       string `json:"reaction"`
	ReactedAt      string `json:"reactedAt"`
	CreatedAt      string `json:"created_at"`
	UpdatedAt      string `json:"updated_at"`
	ExpiredAt      string `json:"expiredAt"`
	OrganizationID string `json:"organization_id"`
	UserFromID     string `json:"user_from_id"`
	UserToID       string `json:"user_to_id"`
}

type TransactionInput

type TransactionInput struct {
	From    string `json:"from"`
	To      string `json:"to"`
	Amount  int    `json:"amount"`
	Comment string `json:"comment"`
}

type TransactionResponse

type TransactionResponse struct {
	Response
	Transaction *Transaction
}

type TransactionsResponse

type TransactionsResponse struct {
	Response
	Transactions []Transaction
}

type User

type User struct {
	ID              string `json:"id"`
	Email           string `json:"email"`
	Image           string `json:"image"`
	OrganizationID  string `json:"organization_id"`
	DisplayName     string `json:"displayName"`
	Role            string `json:"role"`
	CreatedAt       string `json:"created_at"`
	Username        string `json:"username"`
	ExternalRef     string `json:"externalRef"`
	FirstName       string `json:"firstName"`
	LastName        string `json:"lastName"`
	ActiveBalance   int    `json:"activeBalance"`
	InactiveBalance int    `json:"inactiveBalance"`
}

type UsersResponse

type UsersResponse struct {
	Response
	Users []User
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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