Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) CreateJwtSession(ctx context.Context, phoneNumber string) (int64, error)
- func (c *Client) CreateJwtToken(ctx context.Context, phoneNumber string, jwtSessionID int64, otp string) (string, error)
- func (c *Client) GetCsrfToken(ctx context.Context) (string, error)
- func (c *Client) RefreshJwtToken(ctx context.Context, phoneNumber 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 JwtTokenResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidJsonResponse = errors.New("zbox-srv: invalid json response")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateJwtSession ¶
CreateJwtSession create a jwt session with phone number
func (*Client) CreateJwtToken ¶
func (c *Client) CreateJwtToken(ctx context.Context, phoneNumber string, jwtSessionID int64, otp string) (string, error)
CreateJwtToken create a jwt token with jwt session id and otp
func (*Client) GetCsrfToken ¶
GetCsrfToken obtain a fresh csrf token from 0box api server
func (*Client) RefreshJwtToken ¶
func (c *Client) RefreshJwtToken(ctx context.Context, phoneNumber string, token string) (string, error)
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 JwtTokenResponse ¶ added in v1.8.17
type JwtTokenResponse struct {
Token string `json:"jwt_token"`
}
Click to show internal directories.
Click to hide internal directories.