client

package
v0.0.0-...-b894dfb Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseURL = "https://public-api.rustore.ru/public/v1/application"
	AuthURL = "https://public-api.rustore.ru/public/auth"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(
	keyID,
	privateKeyRaw,
	companyID string,
	options ...Option,
) *Client

func (*Client) Auth

func (c *Client) Auth() error

func (*Client) DoRequest

func (c *Client) DoRequest(
	ctx context.Context,
	method string,
	url string,
	sendData []byte,
) (
	io.ReadCloser,
	error,
)

func (*Client) GetEncodedSignature

func (c *Client) GetEncodedSignature(
	keyID,
	privateKeyRaw string,
) (
	string,
	error,
)

func (*Client) GetJWEToken

func (c *Client) GetJWEToken(
	ctx context.Context,
	privateKeyComplete string,
) (
	string,
	error,
)

func (*Client) UploadFile

func (c *Client) UploadFile(
	ctx context.Context,
	url string,
	fileName string,
) (
	io.ReadCloser,
	error,
)

type JWEToken

type JWEToken struct {
	JWE string `json:"jwe"`
}

type JWETokenResponse

type JWETokenResponse struct {
	Code    string   `json:"code"`
	Message string   `json:"message"`
	Body    JWEToken `json:"body"`
}

type Option

type Option func(*Client)

func WithHTTTPClient

func WithHTTTPClient(httpClient *http.Client) Option

func WithTimeout

func WithTimeout(timeOut time.Duration) Option

type RequestOpts

type RequestOpts struct {
	CustomContentType string
}

Jump to

Keyboard shortcuts

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