Documentation ¶
Overview ¶
Provides functions and types to communicate with the 0box API (an off-chain service that provides functionality for the applications out of the scope of the chain transactions).
Index ¶
- Variables
- func GetLogger() *logger.Logger
- type Client
- func (c *Client) CreateJwtToken(ctx context.Context, userID, accessToken string) (string, error)
- func (c *Client) CreateSharedInfo(ctx context.Context, phoneNumber, token string, s SharedInfo) error
- func (c *Client) DeleteSharedInfo(ctx context.Context, phoneNumber, token, authTicket string, lookupHash string) error
- func (c *Client) GetCsrfToken(ctx context.Context) (string, error)
- func (c *Client) GetFreeStorage(ctx context.Context, phoneNumber, token string) (*FreeMarker, error)
- func (c *Client) GetSharedByMe(ctx context.Context, phoneNumber, token string) ([]SharedInfoSent, error)
- func (c *Client) GetSharedByPublic(ctx context.Context, phoneNumber, token string) ([]SharedInfoSent, error)
- func (c *Client) GetSharedToMe(ctx context.Context, phoneNumber, token string) ([]SharedInfoReceived, error)
- func (c *Client) RefreshJwtToken(ctx context.Context, userID string, token string) (string, error)
- func (c *Client) SetRequest(baseUrl, appType string)
- func (c *Client) SetWallet(clientID, clientPrivateKey, clientPublicKey string)
- type CsrfTokenResponse
- type ErrorResponse
- type FreeMarker
- type FreeStorageResponse
- type JsonResult
- type JwtTokenResponse
- type MarkerData
- type SharedInfo
- type SharedInfoReceived
- type SharedInfoSent
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidJsonResponse = errors.New("zbox-srv: invalid json response")
)
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateJwtToken ¶
CreateJwtToken create a jwt token with jwt session id and otp
func (*Client) CreateSharedInfo ¶ added in v1.11.0
func (*Client) DeleteSharedInfo ¶ added in v1.11.0
func (*Client) GetCsrfToken ¶
GetCsrfToken obtain a fresh csrf token from 0box api server
func (*Client) GetFreeStorage ¶ added in v1.11.0
func (*Client) GetSharedByMe ¶ added in v1.11.0
func (*Client) GetSharedByPublic ¶ added in v1.11.0
func (*Client) GetSharedToMe ¶ added in v1.11.0
func (*Client) RefreshJwtToken ¶
RefreshJwtToken refresh jwt token
func (*Client) SetRequest ¶ added in v1.8.12
SetRequest set base url and app type of zbox api request
type CsrfTokenResponse ¶
type CsrfTokenResponse struct {
Token string `json:"csrf_token"`
}
type ErrorResponse ¶
type ErrorResponse struct {
Error json.RawMessage `json:"error"`
}
type FreeMarker ¶ added in v1.11.0
type FreeStorageResponse ¶ added in v1.11.0
func (*FreeStorageResponse) ToMarker ¶ added in v1.11.0
func (fs *FreeStorageResponse) ToMarker() (*FreeMarker, error)
type JsonResult ¶ added in v1.11.0
type JwtTokenResponse ¶ added in v1.8.17
type JwtTokenResponse struct {
Token string `json:"jwt_token"`
}
type MarkerData ¶ added in v1.11.0
type SharedInfo ¶ added in v1.11.0
type SharedInfo struct {}
type SharedInfoReceived ¶ added in v1.11.0
type SharedInfoReceived struct {}
type SharedInfoSent ¶ added in v1.11.0
type SharedInfoSent struct {}
Click to show internal directories.
Click to hide internal directories.