shared

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrOrderNotFound = orderErr("order does not exist")
)

Variables

This section is empty.

Functions

func NewOrderManager

func NewOrderManager(ctx context.Context, orderEndpoint, authenticationEndpoint, apikey string) (*orderManagerImpl, context.CancelFunc)

Types

type AccountInformation

type AccountInformation struct {
	Links struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
		Licenses struct {
			Href string `json:"href"`
		} `json:"licenses"`
	} `json:"_links"`
	ID        string    `json:"id"`
	Status    string    `json:"status"`
	CreatedAt time.Time `json:"createdAt"`
	Roles     []string  `json:"roles"`
	Contract  struct {
		Links struct {
			Self struct {
				Href string `json:"href"`
			} `json:"self"`
			Orders struct {
				Href string `json:"href"`
			} `json:"orders"`
			Payments struct {
				Href string `json:"href"`
			} `json:"payments"`
			Subscriptions struct {
				Href string `json:"href"`
			} `json:"subscriptions"`
			Deliveries struct {
				Href string `json:"href"`
			} `json:"deliveries"`
			Reports struct {
				Href string `json:"href"`
			} `json:"reports"`
		} `json:"_links"`
		ID          string    `json:"id"`
		Status      string    `json:"status"`
		CreatedAt   time.Time `json:"createdAt"`
		Offers      []string  `json:"offers"`
		AmountUnit  string    `json:"amountUnit"`
		Kind        string    `json:"kind"`
		Name        string    `json:"name"`
		Balance     int       `json:"balance"`
		WorkspaceID string    `json:"workspaceId"`
	} `json:"contract"`
}

type Aoi

type Aoi struct {
	Coordinates [][][2]float64 `json:"coordinates"`
	Type        string         `json:"type"`
}

func GetAoiFromGeometry

func GetAoiFromGeometry(scene common.Scene) (Aoi, error)

func (Aoi) Equal

func (a Aoi) Equal(otherAOI Aoi) bool

type OrderManager

type OrderManager interface {
	Create(orderRequest OrderRequest) error
	GetStatus(orderRequest OrderRequest) (map[string]OrderStatus, error)
	GetPrice(orderRequest OrderRequest) (OrderPrice, error)
	GetAccountInformation() (AccountInformation, error)
}

type OrderPrice

type OrderPrice struct {
	Credits           int        `json:"credits"`
	Amount            int        `json:"amount"`
	IsAmountEstimated string     `json:"isAmountEstimated"`
	AreaKm2           float64    `json:"areaKm2"`
	AmountUnit        string     `json:"amountUnit"`
	Orderable         bool       `json:"-"`
	Deliveries        []delivery `json:"-"`
}

type OrderRequest

type OrderRequest struct {
	Kind     string    `json:"kind"`
	Products []Product `json:"products"`
}

type OrderStatus

type OrderStatus struct {
	State        string
	DownloadLink string
	Price        int
	OrderID      string
	DataID       string
	Infos        map[string]string
}

type Product

type Product struct {
	CrsCode               string `json:"crsCode"`
	ProductType           string `json:"productType"`
	RadiometricProcessing string `json:"radiometricProcessing"`
	Aoi                   Aoi    `json:"aoi"`
	ID                    string `json:"id"`
	ImageFormat           string `json:"imageFormat"`
}

Jump to

Keyboard shortcuts

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