emarsys

package module
v0.0.0-...-b3912f7 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: BSD-3-Clause Imports: 19 Imported by: 0

README

Coverage Status GoReportCard

emarsys - Golang Client

API access to https://dev.emarsys.com/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func MakeClient

func MakeClient(opts ...Option) (Client, error)

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithCredentials

func WithCredentials(user, secret string) Option

func WithEnableStaging

func WithEnableStaging(envvarName ...string) Option

func WithHTTPClient

func WithHTTPClient(doFn OptionHTTPRequestFn) Option

func WithTime

func WithTime(now func() time.Time) Option

WithTime shall only be used for testing. It also sets the rand source to the time.

type OptionHTTPRequestFn

type OptionHTTPRequestFn func(req *http.Request) (*http.Response, error)

type ResponseEnvelope

type ResponseEnvelope struct {
	HTTPStatusCode int             `json:"httpStatusCode"`
	ReplyCode      int             `json:"replyCode"` // https://dev.emarsys.com/docs/emarsys-api/ZG9jOjI0ODk5NzY4-http-200-errors
	ReplyText      string          `json:"replyText"`
	Data           json.RawMessage `json:"data"`
	UnmarshalErr   error           `json:"-"`
}

func (*ResponseEnvelope) Error

func (s *ResponseEnvelope) Error() string

Jump to

Keyboard shortcuts

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