Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInstanceNotFound = errors.New("dataset api failed to find instance")
ErrInstanceNotFound returned when the given instance ID is not found in the dataset API.
var ErrInternalError = errors.New("internal error from the dataset api")
ErrInternalError returned when an unrecognised internal error occurs in the dataset API.
var ErrParseAPIResponse = errors.New("failed to parse dataset api response")
ErrParseAPIResponse used when the dataset API response fails to be parsed.
Functions ¶
This section is empty.
Types ¶
type DatasetClient ¶
type DatasetClient interface { GetInstanceBytes(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, instanceID, ifMatch string) (b []byte, eTag string, err error) GetInstanceDimensionsBytes(ctx context.Context, serviceAuthToken, instanceID string, q *dataset.QueryParams, ifMatch string) (b []byte, eTag string, err error) }
DatasetClient represents the dataset client for dataset API
type DatasetStore ¶
type DatasetStore struct {
// contains filtered or unexported fields
}
DatasetStore represents the storage of dimension data.
func NewStore ¶
func NewStore(authToken, datasetAPIURL string, client DatasetClient) *DatasetStore
NewStore returns a new instance of a dimension store.
type Dimension ¶
type Dimension struct { DimensionName string `json:"dimension"` Option string `json:"option"` NodeID string `json:"node_id"` }
Dimension which has been cached from the dataset api
type HeaderCache ¶
type HeaderCache struct {
// contains filtered or unexported fields
}
HeaderCache is cache the for order of dimensions in the input file
func NewOrderCache ¶
func NewOrderCache(orderStore OrderStore, cacheTTL time.Duration) *HeaderCache
NewOrderCache returns a new instance of the order cache that uses the given OrderStore.
type IDStore ¶
type IDStore interface {
GetIDs(ctx context.Context, instanceID string) (map[string]string, error)
}
IDStore represents the data store for dimension id's
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
MemoryCache is an in memory cache of dimensions with database id's.
func NewIDCache ¶
func NewIDCache(idStore IDStore, cacheTTL time.Duration) *MemoryCache
NewIDCache returns a new cache instance that uses the given data store.
func (*MemoryCache) GetNodeIDs ¶
func (mc *MemoryCache) GetNodeIDs(ctx context.Context, instanceID string) (map[string]string, error)
GetNodeIDs returns all dimensions for a given instanceID
type NodeResults ¶
type NodeResults struct {
Items []Dimension `json:"items"`
}
NodeResults wraps dimension node objects for pagination
Directories ¶
Path | Synopsis |
---|---|
Package dimensiontest is a generated GoMock package.
|
Package dimensiontest is a generated GoMock package. |