cleos

package
v0.0.0-...-830b723 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: EUPL-1.2 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	BasePathDev     = "https://api.dev.entur.io/cleos-reporting/api/v1"
	BasePathStaging = "https://api.staging.entur.io/cleos-reporting/api/v1"
	BasePathProd    = "https://api.entur.io/cleos-reporting/api/v1"

	TokenURLDev     = "https://partner.dev.entur.org/oauth/token"
	TokenURLStaging = "https://partner.staging.entur.org/oauth/token"
	TokenURLProd    = "https://partner.entur.org/oauth/token"

	AudienceDev     = "https://cleos.dev.entur.io"
	AudienceStaging = "https://cleos.staging.entur.io"
	AudienceProd    = "https://cleos.entur.io"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrCleos

type ErrCleos string
const (
	ErrNotFound         ErrCleos = "a report for the specified template id was not found"
	ErrAllDownloaded    ErrCleos = "all available reports downloaded, retry later"
	ErrNotGenerated     ErrCleos = "report is being generated, retry later"
	ErrUnauthorized     ErrCleos = "unauthorized"
	ErrForbidden        ErrCleos = "forbidden"
	ErrConflict         ErrCleos = "report failed execution, contact support"
	ErrGone             ErrCleos = "no future reports on this templateID will be generated, stop the job or update the templateID"
	ErrUnknownStatus    ErrCleos = "unknown status"
	ErrInvalidArguments ErrCleos = "invalid arguments"
)

func (ErrCleos) Error

func (e ErrCleos) Error() string

type Report

type Report struct {
	ID          string
	Content     []byte
	ContentType string
	Filename    string
}

type Service

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

func NewService

func NewService(client *http.Client, basePath string) *Service

func (*Service) NextReport

func (s *Service) NextReport(ctx context.Context, templateID, IDAfter string, firstOrderedDate time.Time) (*Report, error)

NextReport fetches the next available report for templateID generated after IDAfter on or after firstOrderedDate

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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