zop

package
v0.0.0-...-dd557b4 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Digest

func Digest(str string) string

Digest generates the digest for the given string by MD5 hash and base64 encoding.

Types

type Client

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

Client defines the client for ZOP express APIs.

func NewClient

func NewClient(companyID, key string, opt ...Options) (*Client, error)

NewClient instantiates a new client.

func (*Client) Execute

func (c *Client) Execute(ctx context.Context, req *Request) (string, error)

Execute executes the given request.

type Options

type Options func(*options)

Options sets the options for the `Client`.

func WithHttpClient

func WithHttpClient(client *http.Client) Options

WithHttpClient sets the http client.

type Request

type Request struct {
	URL string

	// if `Body` is provided, use it with `Content-Type: application/json`
	// otherwise, use `Params` with `Content-Type: application/x-www-form-urlencoded`
	Body   string
	Params map[string]string
}

Request defines the request for ZOP express APIs.

Jump to

Keyboard shortcuts

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