api

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package api is the base for all aep rest functions.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package api is the base for all aep rest functions.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package api is the base for all aep rest functions.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package api is the base for all aep rest functions.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package od contains offer decisiong related functions.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DADownload added in v0.2.0

func DADownload(ctx context.Context, p *AuthenticationConfig, fileId, path string) (*http.Response, error)

func DAGetFile added in v0.2.0

func DAGetFile(ctx context.Context, p *AuthenticationConfig, fileId, start, limit string) (*http.Response, error)

DAGetFile returns a list of files for the passed fileId

func DAGetFiles added in v0.2.0

func DAGetFiles(ctx context.Context, p *AuthenticationConfig, batchId, start, limit string) (*http.Response, error)

DAGetFiles returns a list of files for the passed batchId

func FlowGetConnections added in v0.2.0

func FlowGetConnections(ctx context.Context, auth *AuthenticationConfig, p *FlowGetConnectionsParams) (*http.Response, error)

DAGetFile returns a list of files for the passed fileId

func FlowGetNext added in v0.2.0

func FlowGetNext(ctx context.Context, auth *AuthenticationConfig, url string) (*http.Response, error)

func HandleStatusCode added in v0.2.0

func HandleStatusCode(res *http.Response, err error) (*http.Response, error)

func NewJSONFilterIterator added in v0.2.0

func NewJSONFilterIterator(filter []string, res *http.Response, err error) (*util.JSONFilterIterator, error)

func NewJSONIterator added in v0.2.0

func NewJSONIterator(res *http.Response, err error) (*util.JSONIterator, error)

func NewQuery added in v0.2.0

func NewQuery(res *http.Response, err error) (*util.Query, error)

func UPSGetEntities added in v0.2.0

func UPSGetEntities(ctx context.Context, auth *AuthenticationConfig, p *UPSEntitiesParams) (*http.Response, error)

Types

type AuthenticationConfig

type AuthenticationConfig struct {
	Cache            bool
	DryRun           bool
	Server           string
	Organization     string
	TechnicalAccount string
	Audience         string
	ClientID         string
	ClientSecret     string
	Key              string
	Sandbox          string
	LoadToken        func() (*BearerToken, error)
	SaveToken        func(token *BearerToken) error
}

AuthenticationConfig contains the configuraion for getting the bearer token

func (*AuthenticationConfig) DeleteRequest

func (o *AuthenticationConfig) DeleteRequest(ctx context.Context, url string, a ...interface{}) (interface{}, error)

DeleteRequest sends a http delete request to the passed url

func (*AuthenticationConfig) FullRequest

func (o *AuthenticationConfig) FullRequest(ctx context.Context, verb string, header map[string]string, body io.Reader, url string, a ...interface{}) (interface{}, error)

FullRequest sends a http request with the passed verb to the passed url

func (*AuthenticationConfig) FullRequestRaw added in v0.2.0

func (o *AuthenticationConfig) FullRequestRaw(ctx context.Context, verb string, header map[string]string, body io.Reader, url string, a ...interface{}) (*http.Response, error)

FullRequestRaw sends a http request with the passed verb to the passed url

func (*AuthenticationConfig) GetRequest

func (o *AuthenticationConfig) GetRequest(ctx context.Context, url string, a ...interface{}) (interface{}, error)

GetRequest sends a http get request to the passed url

func (*AuthenticationConfig) GetRequestRaw added in v0.2.0

func (o *AuthenticationConfig) GetRequestRaw(ctx context.Context, url string, a ...interface{}) (*http.Response, error)

GetRequestRaw sends a http get request to the passed url

func (*AuthenticationConfig) GetToken

func (o *AuthenticationConfig) GetToken() (*BearerToken, error)

GetToken uses JWT to get a bearer token

func (*AuthenticationConfig) GetTokenRaw added in v0.2.0

func (o *AuthenticationConfig) GetTokenRaw() (*http.Response, error)

GetTokenRaw uses JWT to get a bearer token

func (*AuthenticationConfig) NoDryRun added in v0.2.0

func (*AuthenticationConfig) PatchRequest

func (o *AuthenticationConfig) PatchRequest(ctx context.Context, header map[string]string, data []byte, url string, a ...interface{}) (interface{}, error)

PatchRequest sends a http patch request to the passed url

func (*AuthenticationConfig) PostJSONRequest

func (o *AuthenticationConfig) PostJSONRequest(ctx context.Context, obj interface{}, url string, a ...interface{}) (interface{}, error)

PostJSONRequest serializes the passed object to JSON and sends a http post request to the passed url

func (*AuthenticationConfig) PostJSONRequestRaw added in v0.2.0

func (o *AuthenticationConfig) PostJSONRequestRaw(ctx context.Context, obj interface{}, url string, a ...interface{}) (*http.Response, error)

PostJSONRequestRaw serializes the passed object to JSON and sends a http post request to the passed url

func (*AuthenticationConfig) PostRequest

func (o *AuthenticationConfig) PostRequest(ctx context.Context, header map[string]string, data []byte, url string, a ...interface{}) (interface{}, error)

PostRequest sends a http post request to the passed url

func (*AuthenticationConfig) Request

func (o *AuthenticationConfig) Request(ctx context.Context, verb, url string, a ...interface{}) (interface{}, error)

Request sends a http request with the passed verb to the passed url

func (*AuthenticationConfig) UpdateHeader

func (o *AuthenticationConfig) UpdateHeader(req *http.Request) error

UpdateHeader adds the authentication headers to the passed http request

type BearerToken

type BearerToken struct {
	Token   string
	Expires time.Time
}

BearerToken contains a token and an expiration date

func (*BearerToken) LocalTime

func (t *BearerToken) LocalTime() string

LocalTime returns the expiry date as string in the local time zone

func (*BearerToken) ValidIn

func (t *BearerToken) ValidIn(d time.Duration) bool

ValidIn in checks if the token is still valid for passed duration

type CMD added in v0.2.0

type CMD struct {
	URL string
}

type FlowGetConnectionsParams added in v0.2.0

type FlowGetConnectionsParams struct {
	Property          string
	Limit             int
	OrderBy           string
	ContinuationToken string
	Count             bool
}

type FlowPaged added in v0.2.0

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

func NewFlowPaged added in v0.2.0

func (*FlowPaged) Execute added in v0.2.0

func (fp *FlowPaged) Execute(path []string, f func(util.JSONResponse) error) error

func (*FlowPaged) First added in v0.2.0

func (fp *FlowPaged) First() (util.JSONResponse, error)

type Paged added in v0.2.0

type Paged interface {
	First() (util.JSONResponse, error)
	Execute([]string, func(util.JSONResponse) error) error
}

type UPSEntitiesParams added in v0.2.0

type UPSEntitiesParams struct {
	Schema        string
	RelatedSchema string
	ID            string
	NS            string
	RelatedID     string
	RelatedNS     string
	Fields        string
	MP            string
	Start         string
	End           string
	Limit         int
	Order         string
	Property      string
	CA            bool
	TimeFormat    string
}

Directories

Path Synopsis
Package acl consists of access control list functions.
Package acl consists of access control list functions.
Package catalog consists of catalog functions.
Package catalog consists of catalog functions.
Package od contains offer decisiong related functions.
Package od contains offer decisiong related functions.
Package sandbox contains all sandbox related functions.
Package sandbox contains all sandbox related functions.
Package token contains all token related functions.
Package token contains all token related functions.
Package token contains all token related functions.
Package token contains all token related functions.

Jump to

Keyboard shortcuts

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