Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (client *Client) CreateTransaction(ctx context.Context, req *CreateTransactionRequest) (*CreateTransactionResponse, error)
- func (client *Client) GetMe(ctx context.Context, req *GetMeRequest) (*GetMeResponse, error)
- func (client *Client) GetUser(ctx context.Context, req *GetUserRequest) (*User, error)
- func (client *Client) ListUsers(ctx context.Context, req *ListUsersRequest) (*ListUsersResponse, error)
- type CreateTransactionRequest
- type CreateTransactionResponse
- type GetMeRequest
- type GetMeResponse
- type GetUserRequest
- type ListUsersRequest
- type ListUsersResponse
- type User
Constants ¶
View Source
const ( UrlMe = "https://api.givebriq.com/v1/me" UrlTransactions = "https://api.givebriq.com/v1/me/transactions" UrlUsers = "https://api.givebriq.com/v1/users" )
View Source
const (
AppGive = "give"
)
Variables ¶
View Source
var (
ErrNotFound error = errors.New("not found")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Briq API client
func (*Client) CreateTransaction ¶
func (client *Client) CreateTransaction(ctx context.Context, req *CreateTransactionRequest) (*CreateTransactionResponse, error)
CreateTransaction creates a transaction, which is the way to give briqs.
func (*Client) GetMe ¶
func (client *Client) GetMe(ctx context.Context, req *GetMeRequest) (*GetMeResponse, error)
func (*Client) ListUsers ¶
func (client *Client) ListUsers(ctx context.Context, req *ListUsersRequest) (*ListUsersResponse, error)
type CreateTransactionResponse ¶
type CreateTransactionResponse struct { Amount int `json:"amount,omitempty"` App string `json:"app,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` From string `json:"from,omitempty"` Id uuid.UUID `json:"id,omitempty"` IsAnonymous bool `json:"isAnonymous,omitempty"` ReactedAt *time.Time `json:"reactedAt,omitempty"` Reaction *string `json:"reaction,omitempty"` To string `json:"to,omitempty"` UserFromId *uuid.UUID `json:"user_from_id,omitempty"` UserToId *uuid.UUID `json:"user_to_id,omitempty"` }
type GetMeRequest ¶
type GetMeRequest struct { }
type GetMeResponse ¶
type GetMeResponse struct { Id uuid.UUID `json:"id,omitempty"` Username string `json:"username,omitempty"` DisplayName string `json:"displayName,omitempty"` Email string `json:"email,omitempty"` FirstName string `json:"firstName,omitempty"` LastName string `json:"lastName,omitempty"` ExternalRef string `json:"externalRef,omitempty"` Image string `json:"image,omitempty"` Role string `json:"role,omitempty"` ActiveBalance int `json:"activeBalance,omitempty"` InactiveBalance int `json:"inactiveBalance,omitempty"` }
type GetUserRequest ¶
type GetUserRequest struct {
Username string `json:"username,omitempty"`
}
type ListUsersRequest ¶
type ListUsersRequest struct { }
type ListUsersResponse ¶
type ListUsersResponse struct {
Users []User `json:"users,omitempty"`
}
type User ¶
type User struct { Id uuid.UUID `json:"id,omitempty"` Username string `json:"username,omitempty"` DisplayName string `json:"displayName,omitempty"` Email string `json:"email,omitempty"` ActiveBalance int `json:"activeBalance,omitempty"` InactiveBalance int `json:"inactiveBalance,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` Suspended bool `json:"suspended,omitempty"` Role string `json:"role,omitempty"` Points int `json:"points,omitempty"` }
Click to show internal directories.
Click to hide internal directories.