common

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LIVE    Mode = "LIVE"
	SANDBOX Mode = "SANDBOX"

	// --------
	BASE_URL string = "https://api.durianpay.id/v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	ClientConfig *ClientConfig
	HttpClient   *http.Client
	Logger       *logrus.Logger
}

func NewAgent

func NewAgent(clientConfig *ClientConfig) *Agent

func (*Agent) Call

func (agent *Agent) Call(
	ctx context.Context,
	method,
	url string,
	body any,
	response any,
) (err error)

type ClientConfig

type ClientConfig struct {
	Mode          Mode
	ApiKey        string
	EnableLogging bool
}

type ErrorResponse

type ErrorResponse struct {
	Error     string `json:"error"`
	ErrorCode string `json:"error_code"`
}

type Mode

type Mode string

type QueryParams

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

Jump to

Keyboard shortcuts

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