hierarchy

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorUnexpectedStatusCode        = errors.New("unexpected status code from api")
	ErrorInstanceNotFound            = errors.New("Instance not found")
	ErrorRootDimensionOptionNotFound = errors.New("Root dimension not found")
	ErrorDimensionOptionNotFound     = errors.New("Dimension option not found")
)

A list of errors that the dataset package could return

Functions

This section is empty.

Types

type API

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

API aggregates a client and URL and other common data for accessing the API

func NewHierarchyAPI

func NewHierarchyAPI(clienter dphttp.Clienter, hierarchyAPIURL string) *API

NewHierarchyAPI creates an HierarchyAPI object

func (*API) GetDimensionOption

func (api *API) GetDimensionOption(ctx context.Context, instanceID, dimension, codeID string) (dimensionOption *models.Response, err error)

GetDimensionOption queries the Hierarchy API to get a dimension option for hierarchy

func (*API) GetRootDimensionOption

func (api *API) GetRootDimensionOption(ctx context.Context, instanceID, dimension string) (rootDimensionOption *models.Response, err error)

GetRootDimensionOption queries the Hierarchy API to get the root dimension option for hierarchy

type APIer

type APIer interface {
	GetRootDimensionOption(ctx context.Context, instanceID, dimension string) (*models.Response, error)
	GetDimensionOption(ctx context.Context, instanceID, dimension, codeID string) (*models.Response, error)
}

APIer - An interface used to access the HierarchyAPI

Jump to

Keyboard shortcuts

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