api

package
v0.3.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SaveModeUpdateDataset                                 = "UpdateDataset"
	SaveModeUpdateDatasetAndDependenciesUnlessNewErrors   = "UpdateDatasetAndDependenciesUnlessNewErrors"
	SaveModeUpdateDatasetAndDependenciesIgnoringAllErrors = "UpdateDatasetAndDependenciesIgnoringAllErrors"
	SaveModePreflightDataset                              = "PreflightDataset"
	SaveModePreflightDatasetAndDependencies               = "PreflightDatasetAndDependencies"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	GQLClient
}

Client implements our current API given an interface that can speak GraphQL

func New

func New(c GQLClient) *Client

New returns client to native API

func (*Client) CreateDeferredForeignKey

func (c *Client) CreateDeferredForeignKey(workspaceid string, config *DeferredForeignKeyInput) (*DeferredForeignKey, error)

func (*Client) DeleteDataset

func (c *Client) DeleteDataset(id string) error

DeleteDataset deletes dataset by ID.

func (*Client) DeleteDeferredForeignKey

func (c *Client) DeleteDeferredForeignKey(id string) error

DeleteDeferredForeignKey deletes dfk by ID.

func (*Client) GetDataset

func (c *Client) GetDataset(id string) (*Dataset, error)

GetDataset retrieves dataset.

func (*Client) GetDeferredForeignKey

func (c *Client) GetDeferredForeignKey(id string) (*DeferredForeignKey, error)

func (*Client) GetWorkspace

func (c *Client) GetWorkspace(id string) (*Workspace, error)

func (*Client) ListDatasets

func (c *Client) ListDatasets() (ds []*Dataset, err error)

ListDatasets retrieves all datasets across workspaces. No filtering provided for now.

func (*Client) ListWorkspaces

func (c *Client) ListWorkspaces() ([]*Workspace, error)

func (*Client) SaveDataset

func (c *Client) SaveDataset(workspaceID string, d *DatasetInput, t *TransformInput) (*Dataset, error)

SaveDataset creates and updates datasets

func (*Client) UpdateDeferredForeignKey

func (c *Client) UpdateDeferredForeignKey(id string, config *DeferredForeignKeyInput) (*DeferredForeignKey, error)

type Dataset

type Dataset struct {
	ID               ObjectIdScalar `json:"id"`
	WorkspaceId      ObjectIdScalar `json:"workspaceId"`
	Version          string         `json:"version"`
	Label            string         `json:"label"`
	LatencyDesired   *time.Duration `json:"latencyDesired"`
	FreshnessDesired *time.Duration `json:"freshnessDesired"`
	Typedef          Typedef        `json:"typedef"`
	IconURL          *string        `json:"iconUrl"`
	PathCost         *int64         `json:"pathCost"`
	Transform        *Transform     `json:"transform"`
	ForeignKeys      []ForeignKey   `json:"foreignKeys"`
}

func (*Dataset) Decode

func (d *Dataset) Decode(v interface{}) error

type DatasetInput

type DatasetInput struct {
	ID               *ObjectIdScalar `json:"id,omitempty"`
	Label            string          `json:"label"`
	Deleted          bool            `json:"deleted"`
	LatencyDesired   *string         `json:"latencyDesired"`
	FreshnessDesired *string         `json:"freshnessDesired"`
	IconURL          *string         `json:"iconUrl"`
	PathCost         *string         `json:"pathCost"`
}

type DatasetSaveResult

type DatasetSaveResult struct {
	Dataset *Dataset `json:"dataset"`
}

type DeferredDatasetReference

type DeferredDatasetReference struct {
	DatasetID   *ObjectIdScalar `json:"datasetId,omitempty"`
	DatasetPath *string         `json:"datasetPath,omitempty"`
}

type DeferredDatasetReferenceInput

type DeferredDatasetReferenceInput struct {
	DatasetID   *ObjectIdScalar `json:"datasetId,omitempty"`
	DatasetPath *string         `json:"datasetPath,omitempty"`
}

type DeferredForeignKey

type DeferredForeignKey struct {
	ID            ObjectIdScalar           `json:"id"`
	WorkspaceID   ObjectIdScalar           `json:"workspaceId"`
	SourceDataset DeferredDatasetReference `json:"source"`
	TargetDataset DeferredDatasetReference `json:"target"`
	SrcFields     []string                 `json:"srcFields"`
	DstFields     []string                 `json:"dstFields"`
	Label         *string                  `json:"label,omitempty"`
	Resolution    *ResolvedForeignKey      `json:"resolution,omitempty"`
	Status        DeferredForeignKeyStatus `json:"status"`
}

type DeferredForeignKeyInput

type DeferredForeignKeyInput struct {
	SourceDataset DeferredDatasetReferenceInput `json:"sourceDataset"`
	TargetDataset DeferredDatasetReferenceInput `json:"targetDataset"`
	SrcFields     []string                      `json:"srcFields"`
	DstFields     []string                      `json:"dstFields"`
	Label         *string                       `json:"label,omitempty"`
}

type DeferredForeignKeyStatus

type DeferredForeignKeyStatus struct {
	ID                      ObjectIdScalar `json:"id"`
	FoundSource             bool           `json:"foundSource"`
	FoundTarget             bool           `json:"foundTarget"`
	MatchedSourceFields     bool           `json:"matchedSourceFields"`
	MatchedTargetFields     bool           `json:"matchedTargetFields"`
	FieldTypesAreComparable bool           `json:"fieldTypesAreComparable"`
	//  EnglishError is empty if there's no error, else it's a human-readable
	//  string describing what things prevent the key from resolving.
	ErrorText string `json:"errorText"`
}

If the foreign key doesn't match some datasets, that may be because of a number of reasons. A "true" in a status field means that that part of the resolution is A-OK, a "false" means that an error happened in that part.

type DependencyHandlingInput

type DependencyHandlingInput struct {
	SaveMode             SaveMode         `json:"saveMode"`
	IgnoreSpecificErrors []ObjectIdScalar `json:"ignoreSpecificErrors"`
}

type ForeignKey

type ForeignKey struct {
	TargetDataset        *int64   `json:"targetDataset,string"`
	TargetStageLabel     *string  `json:"targetStageLabel"`
	Label                *string  `json:"label"`
	TargetLabelFieldName *string  `json:"targetLabelFieldName"`
	SrcFields            []string `json:"srcFields"`
	DstFields            []string `json:"dstFields"`
}

type GQLClient

type GQLClient interface {
	Run(request string, vars map[string]interface{}) (map[string]interface{}, error)
}

GQLClient runs GQL queries

type InputDefinition

type InputDefinition struct {
	InputName   string          `json:"inputName"`
	InputRole   *InputRole      `json:"inputRole"`
	DatasetID   *ObjectIdScalar `json:"datasetId,omitempty"`
	DatasetPath *string         `json:"datasetPath"`
	StageID     string          `json:"stageId"`
}

type InputDefinitionInput

type InputDefinitionInput struct {
	InputName   string          `json:"inputName"`
	InputRole   *InputRole      `json:"inputRole"`
	DatasetID   *ObjectIdScalar `json:"datasetId,omitempty"`
	DatasetPath *string         `json:"datasetPath"`
	StageID     string          `json:"stageID"`
}

type InputRole

type InputRole string
const (
	InputRoleDefault   InputRole = ""
	InputRoleData      InputRole = "Data"
	InputRoleReference InputRole = "Reference"
)

func (InputRole) IsValid

func (e InputRole) IsValid() bool

func (InputRole) String

func (e InputRole) String() string

type ObjectIdScalar

type ObjectIdScalar int64

func ObjectIdScalarPointer

func ObjectIdScalarPointer(i int64) *ObjectIdScalar

func (ObjectIdScalar) Int64

func (i ObjectIdScalar) Int64() int64

func (ObjectIdScalar) MarshalJSON

func (o ObjectIdScalar) MarshalJSON() ([]byte, error)

func (ObjectIdScalar) String

func (i ObjectIdScalar) String() string

func (*ObjectIdScalar) UnmarshalJSON

func (o *ObjectIdScalar) UnmarshalJSON(b []byte) error

type ResolvedForeignKey

type ResolvedForeignKey struct {
	SourceID ObjectIdScalar `json:"sourceId"`
	TargetID ObjectIdScalar `json:"targetId"`
}

type ResultStatus

type ResultStatus struct {
	Success      bool                   `json:"success"`
	ErrorMessage string                 `json:"errorMessage"`
	DetailedInfo map[string]interface{} `json:"detailedInfo"`
}

func (*ResultStatus) Error

func (s *ResultStatus) Error() error

type SaveMode

type SaveMode string

type StageQuery

type StageQuery struct {
	StageID  string             `json:"stageID"`
	Input    []*InputDefinition `json:"input"`
	Pipeline string             `json:"pipeline"`
}

type StageQueryInput

type StageQueryInput struct {
	Input    []InputDefinitionInput `json:"input"`
	StageID  string                 `json:"stageID"`
	Pipeline string                 `json:"pipeline"`
}

type Transform

type Transform struct {
	Dataset *Dataset          `json:"dataset"`
	ID      ObjectIdScalar    `json:"id"`
	Current *TransformVersion `json:"current"`
}

type TransformInput

type TransformInput struct {
	QueryLanguage string             `json:"queryLanguage"`
	OutputStage   string             `json:"outputStage"`
	Stages        []*StageQueryInput `json:"stages"`
}

type TransformVersion

type TransformVersion struct {
	Transform   *Transform    `json:"transform"`
	OutputStage string        `json:"outputStage"`
	Stages      []*StageQuery `json:"stages"`
}

type Typedef

type Typedef struct {
	Definition map[string]interface{} `json:"definition"`
}

type Workspace

type Workspace struct {
	ID       ObjectIdScalar `json:"id"`
	Label    string         `json:"label"`
	Datasets []*Dataset     `json:"datasets"`
}

Jump to

Keyboard shortcuts

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