alsocloud

package
v0.0.0-...-b302809 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Austria     = "https://marketplace.also.at"
	Switzerland = "https://marketplace.also.ch"
	Germany     = "https://marketplace.also.de"
	Denmark     = "https://marketplace.also.dk"
	Estonia     = "https://marketplace.also.ee"
	Finland     = "https://marketplace.also.fi"
	Lithuania   = "https://marketplace.also.lt"
	Netherlands = "https://marketplace.also.nl"
	Norway      = "https://marketplace.also.no"
	Sweden      = "https://marketplace.also.se"
	Slovenia    = "https://marketplace.also.si"
	France      = "https://marketplace.alsofrance.fr"
	Latvia      = "https://marketplace.alsolatvia.lv"
	Poland      = "https://marketplace.alsopolska.pl"
	Debug       = "https://marketplacetest.ccpaas.net"
)

Constants for different marketplaces For Testing use Debug

View Source
const (
	Version = "1.0.0"
)

const Version shows the version of the wrapper

Variables

View Source
var DefaultHTTPClient = &http.Client{
	Jar:       nil,
	Transport: DefaultHTTPTransport,
}

DefaultHTTPClient is an http.Client with the DefaultHTTPTransport and (Cookie) Jar set nil.

View Source
var DefaultHTTPTransport = &http.Transport{
	DisableKeepAlives: true,
}

DefaultHTTPTransport is an http.RoundTripper that has DisableKeepAlives set true.

Functions

This section is empty.

Types

type Client

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

Client represents the struct for building the client

func NewClient

func NewClient(marketplace string, apiUser string, apiPassword string, options *Options) (*Client, error)

NewClient creates a new instance of client

func (*Client) Post

func (c *Client) Post(ctx context.Context, endpoint string, data interface{}) (io.ReadCloser, http.Header, int, error)

Post does a POST request to API. It Accepts Context, Endpoint and Data as Input. Returns io.ReadCloser,http.Header,Statuscode,error.

func (*Client) Validate

func (c *Client) Validate(ctx context.Context) bool

Validate validates the session and checks if session is still active. If still active returns true else returns false

type Options

type Options struct {
	APIPrefix     string
	LoginEndpoint string
	UserAgent     string
	Timeout       time.Duration
	VerifySSL     bool
	Batchsize     int
	Log           bool
}

Options for Wrapper Can be changed on creating Client

Jump to

Keyboard shortcuts

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