Documentation ¶
Index ¶
- func Errors(errors []*Error) error
- func GetAPIEndpoint(apiVersion ApiVersion) string
- func NewDefaultBackend(options ...BackendOption) defaultBackend
- func NewSubCmd() *cobra.Command
- type ApiVersion
- type BackendOption
- type Complex
- type ComplexData
- type Config
- type DataSet
- type DataSetRef
- type DataType
- type Error
- type Hint
- type Link
- type Model
- type ModelField
- type Query
- type Response
- type UqlClient
- type UqlClientOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAPIEndpoint ¶ added in v0.50.0
func GetAPIEndpoint(apiVersion ApiVersion) string
func NewDefaultBackend ¶ added in v0.51.0
func NewDefaultBackend(options ...BackendOption) defaultBackend
Types ¶
type ApiVersion ¶
type ApiVersion string
UQL API version type, supporting a limited set of values. Implements the StringEnumer interface defined by the fsoc config package in order to support parsing apiver from an fsoc config file.
const ( ApiVersion1 ApiVersion = ApiVersion("v1") ApiVersionDefault ApiVersion = ApiVersion1 )
constants for direct use
func (*ApiVersion) String ¶ added in v0.50.0
func (a *ApiVersion) String() string
func (*ApiVersion) ValidateAndSet ¶ added in v0.50.0
func (a *ApiVersion) ValidateAndSet(v any) error
type BackendOption ¶ added in v0.51.0
type BackendOption func(c *defaultBackend)
func WithBackendApiOptions ¶ added in v0.51.0
func WithBackendApiOptions(options *api.Options) BackendOption
type ComplexData ¶
func (ComplexData) Model ¶
func (c ComplexData) Model() *Model
func (ComplexData) Values ¶
func (c ComplexData) Values() [][]any
type Config ¶ added in v0.50.0
type Config struct { // TODO ApiVersion *ApiVersion `mapstructure:"apiver,omitempty" fsoc-help:"API version to use for UQL queries. The default is \"v1\"."` }
Config defines the subsystem configuration under fsoc
var GlobalConfig Config
type DataSet ¶
type DataSet struct { Name string DataModel *Model Metadata map[string]any Data [][]any Links map[string]Link }
DataSet holds the result data along with its name, structure (Model) and metadata
type DataSetRef ¶
DataSetRef is a reference to another data set within the Response
type Hint ¶
type Hint struct { Kind string `json:"kind"` Field string `json:"field"` Type string `json:"type"` }
Hint provides additional information about a ModelField such as the MELT kind, MELT field and type
type Model ¶
type Model struct { Name string `json:"name"` Fields []ModelField `json:"fields"` }
Model represents the structure of the response data
type ModelField ¶
type ModelField struct { Alias string `json:"alias"` Type string `json:"type"` Form string `json:"form"` Hints *Hint `json:"hints"` Model *Model `json:"model"` }
ModelField is a description of one column of one data set
func (*ModelField) IsReference ¶
func (mf *ModelField) IsReference() bool
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response represents a parsed UQL response body
type UqlClient ¶ added in v0.51.0
type UqlClient interface { // ExecuteQuery sends an execute request to the UQL service ExecuteQuery(query *Query) (*Response, error) // ContinueQuery sends a continue request to the UQL service ContinueQuery(dataSet *DataSet, rel string) (*Response, error) }
Default clients that can be used as `uql.Client` from other packages - Client should be used to go with the default API version (possibly overridden in fsoc config) - ClientV1 should be used when `v1` is required
var ClientV1 UqlClient = NewClient(WithClientApiVersion(ApiVersion1))
func NewClient ¶ added in v0.51.0
func NewClient(options ...UqlClientOption) UqlClient
type UqlClientOption ¶ added in v0.51.0
type UqlClientOption func(c *defaultClient)
func WithClientApiVersion ¶ added in v0.51.0
func WithClientApiVersion(version ApiVersion) UqlClientOption