Documentation ¶
Index ¶
- type Aggregate
- func (j Aggregate) AsColumnCount() (*AggregateColumnCount, error)
- func (j Aggregate) AsSingleColumn() (*AggregateSingleColumn, error)
- func (j Aggregate) AsStarCount() (*AggregateStarCount, error)
- func (j Aggregate) Interface() AggregateEncoder
- func (j Aggregate) InterfaceT() (AggregateEncoder, error)
- func (j Aggregate) Type() (AggregateType, error)
- func (j *Aggregate) UnmarshalJSON(b []byte) error
- type AggregateColumnCount
- type AggregateEncoder
- type AggregateFunctionDefinition
- type AggregateSingleColumn
- type AggregateStarCount
- type AggregateType
- type Argument
- func (j Argument) AsLiteral() (*ArgumentLiteral, error)
- func (j Argument) AsVariable() (*ArgumentVariable, error)
- func (j Argument) Interface() ArgumentEncoder
- func (j Argument) InterfaceT() (ArgumentEncoder, error)
- func (j Argument) MarshalJSON() ([]byte, error)
- func (j *Argument) UnmarshalJSON(b []byte) error
- type ArgumentEncoder
- type ArgumentInfo
- type ArgumentLiteral
- type ArgumentType
- type ArgumentVariable
- type ArrayType
- type Capabilities
- type CapabilitiesResponse
- type CapabilitiesResponseMarshaler
- type CollectionInfo
- type CollectionInfoArguments
- type CollectionInfoForeignKeys
- type CollectionInfoUniquenessConstraints
- type ColumnField
- type ComparisonOperatorCustom
- type ComparisonOperatorDefinition
- func (j ComparisonOperatorDefinition) AsCustom() (*ComparisonOperatorCustom, error)
- func (j ComparisonOperatorDefinition) AsEqual() (*ComparisonOperatorEqual, error)
- func (j ComparisonOperatorDefinition) AsIn() (*ComparisonOperatorIn, error)
- func (j ComparisonOperatorDefinition) Interface() ComparisonOperatorDefinitionEncoder
- func (j ComparisonOperatorDefinition) InterfaceT() (ComparisonOperatorDefinitionEncoder, error)
- func (j ComparisonOperatorDefinition) Type() (ComparisonOperatorDefinitionType, error)
- func (j *ComparisonOperatorDefinition) UnmarshalJSON(b []byte) error
- type ComparisonOperatorDefinitionEncoder
- type ComparisonOperatorDefinitionType
- type ComparisonOperatorEqual
- type ComparisonOperatorIn
- type ComparisonTarget
- type ComparisonTargetType
- type ComparisonValue
- func (cv ComparisonValue) AsColumn() (*ComparisonValueColumn, error)
- func (cv ComparisonValue) AsScalar() (*ComparisonValueScalar, error)
- func (cv ComparisonValue) AsVariable() (*ComparisonValueVariable, error)
- func (cv ComparisonValue) Interface() ComparisonValueEncoder
- func (cv ComparisonValue) InterfaceT() (ComparisonValueEncoder, error)
- func (cv ComparisonValue) Type() (ComparisonValueType, error)
- func (j *ComparisonValue) UnmarshalJSON(b []byte) error
- type ComparisonValueColumn
- type ComparisonValueEncoder
- type ComparisonValueScalar
- type ComparisonValueType
- type ComparisonValueVariable
- type ConnectorError
- func BadGatewayError(message string, details map[string]any) *ConnectorError
- func BadRequestError(message string, details map[string]any) *ConnectorError
- func ConflictError(message string, details map[string]any) *ConnectorError
- func ForbiddenError(message string, details map[string]any) *ConnectorError
- func InternalServerError(message string, details map[string]any) *ConnectorError
- func NewConnectorError(statusCode int, message string, details map[string]any) *ConnectorError
- func NotSupportedError(message string, details map[string]any) *ConnectorError
- func UnauthorizeError(message string, details map[string]any) *ConnectorError
- func UnprocessableContentError(message string, details map[string]any) *ConnectorError
- type ErrorResponse
- type ExistsCapabilities
- type ExistsInCollection
- func (j ExistsInCollection) AsNestedCollection() (*ExistsInCollectionNestedCollection, error)
- func (j ExistsInCollection) AsRelated() (*ExistsInCollectionRelated, error)
- func (j ExistsInCollection) AsUnrelated() (*ExistsInCollectionUnrelated, error)
- func (j ExistsInCollection) Interface() ExistsInCollectionEncoder
- func (j ExistsInCollection) InterfaceT() (ExistsInCollectionEncoder, error)
- func (j ExistsInCollection) Type() (ExistsInCollectionType, error)
- func (j *ExistsInCollection) UnmarshalJSON(b []byte) error
- type ExistsInCollectionEncoder
- type ExistsInCollectionNestedCollection
- type ExistsInCollectionRelated
- type ExistsInCollectionType
- type ExistsInCollectionUnrelated
- type ExplainResponse
- type ExplainResponseDetails
- type Expression
- func (j Expression) AsAnd() (*ExpressionAnd, error)
- func (j Expression) AsBinaryComparisonOperator() (*ExpressionBinaryComparisonOperator, error)
- func (j Expression) AsExists() (*ExpressionExists, error)
- func (j Expression) AsNot() (*ExpressionNot, error)
- func (j Expression) AsOr() (*ExpressionOr, error)
- func (j Expression) AsUnaryComparisonOperator() (*ExpressionUnaryComparisonOperator, error)
- func (j Expression) Interface() ExpressionEncoder
- func (j Expression) InterfaceT() (ExpressionEncoder, error)
- func (j Expression) Type() (ExpressionType, error)
- func (j *Expression) UnmarshalJSON(b []byte) error
- type ExpressionAnd
- type ExpressionBinaryComparisonOperator
- type ExpressionEncoder
- type ExpressionExists
- type ExpressionNot
- type ExpressionOr
- type ExpressionType
- type ExpressionUnaryComparisonOperator
- type Field
- type FieldEncoder
- type FieldType
- type ForeignKeyConstraint
- type ForeignKeyConstraintColumnMapping
- type FunctionInfo
- type FunctionInfoArguments
- type LeafCapability
- type MutationCapabilities
- type MutationOperation
- type MutationOperationResults
- func (j MutationOperationResults) AsProcedure() (*ProcedureResult, error)
- func (j MutationOperationResults) Interface() MutationOperationResultsEncoder
- func (j MutationOperationResults) InterfaceT() (MutationOperationResultsEncoder, error)
- func (j MutationOperationResults) Type() (MutationOperationType, error)
- func (j *MutationOperationResults) UnmarshalJSON(b []byte) error
- type MutationOperationResultsEncoder
- type MutationOperationType
- type MutationRequest
- type MutationRequestCollectionRelationships
- type MutationResponse
- type NamedType
- type NestedArray
- type NestedField
- func (j NestedField) AsArray() (*NestedArray, error)
- func (j NestedField) AsObject() (*NestedObject, error)
- func (j NestedField) Interface() NestedFieldEncoder
- func (j NestedField) InterfaceT() (NestedFieldEncoder, error)
- func (j NestedField) IsNil() bool
- func (j NestedField) Type() (NestedFieldType, error)
- func (j *NestedField) UnmarshalJSON(b []byte) error
- type NestedFieldCapabilities
- type NestedFieldEncoder
- type NestedFieldType
- type NestedObject
- type NullableType
- type ObjectField
- type ObjectFieldArguments
- type ObjectType
- type ObjectTypeFields
- type OrderBy
- type OrderByColumn
- type OrderByElement
- type OrderBySingleColumnAggregate
- type OrderByStarCountAggregate
- type OrderByTarget
- func (j OrderByTarget) AsColumn() (*OrderByColumn, error)
- func (j OrderByTarget) AsSingleColumnAggregate() (*OrderBySingleColumnAggregate, error)
- func (j OrderByTarget) AsStarCountAggregate() (*OrderByStarCountAggregate, error)
- func (j OrderByTarget) Interface() OrderByTargetEncoder
- func (j OrderByTarget) InterfaceT() (OrderByTargetEncoder, error)
- func (j OrderByTarget) Type() (OrderByTargetType, error)
- func (j *OrderByTarget) UnmarshalJSON(b []byte) error
- type OrderByTargetEncoder
- type OrderByTargetType
- type OrderDirection
- type PathElement
- type PathElementArguments
- type PredicateType
- type ProcedureInfo
- type ProcedureInfoArguments
- type ProcedureResult
- type Query
- type QueryAggregates
- type QueryCapabilities
- type QueryFields
- type QueryRequest
- type QueryRequestArguments
- type QueryRequestCollectionRelationships
- type QueryRequestVariablesElem
- type QueryResponse
- type RawCapabilitiesResponse
- type RawSchemaResponse
- type Relationship
- type RelationshipArgument
- func (j RelationshipArgument) AsColumn() (*RelationshipArgumentColumn, error)
- func (j RelationshipArgument) AsLiteral() (*RelationshipArgumentLiteral, error)
- func (j RelationshipArgument) AsVariable() (*RelationshipArgumentVariable, error)
- func (j RelationshipArgument) Interface() RelationshipArgumentEncoder
- func (j RelationshipArgument) InterfaceT() (RelationshipArgumentEncoder, error)
- func (j *RelationshipArgument) UnmarshalJSON(b []byte) error
- type RelationshipArgumentColumn
- type RelationshipArgumentEncoder
- type RelationshipArgumentLiteral
- type RelationshipArgumentType
- type RelationshipArgumentVariable
- type RelationshipArguments
- type RelationshipCapabilities
- type RelationshipColumnMapping
- type RelationshipField
- type RelationshipType
- type RowFieldValue
- type RowSet
- type RowSetAggregates
- type ScalarType
- type ScalarTypeAggregateFunctions
- type SchemaGeneratedJson
- type SchemaResponse
- type SchemaResponseMarshaler
- type SchemaResponseObjectTypes
- type SchemaResponseScalarTypes
- type Type
- func (ty Type) AsArray() (*ArrayType, error)
- func (ty Type) AsNamed() (*NamedType, error)
- func (ty Type) AsNullable() (*NullableType, error)
- func (ty Type) AsPredicate() (*PredicateType, error)
- func (ty Type) Interface() TypeEncoder
- func (ty Type) InterfaceT() (TypeEncoder, error)
- func (ty Type) IsZero() bool
- func (ty Type) String() string
- func (ty Type) Type() (TypeEnum, error)
- func (j *Type) UnmarshalJSON(b []byte) error
- type TypeEncoder
- type TypeEnum
- type TypeRepresentation
- func (ty TypeRepresentation) AsBigDecimal() (*TypeRepresentationBigDecimal, error)
- func (ty TypeRepresentation) AsBigInteger() (*TypeRepresentationBigInteger, error)
- func (ty TypeRepresentation) AsBoolean() (*TypeRepresentationBoolean, error)
- func (ty TypeRepresentation) AsBytes() (*TypeRepresentationBytes, error)
- func (ty TypeRepresentation) AsDate() (*TypeRepresentationDate, error)
- func (ty TypeRepresentation) AsEnum() (*TypeRepresentationEnum, error)
- func (ty TypeRepresentation) AsFloat32() (*TypeRepresentationFloat32, error)
- func (ty TypeRepresentation) AsFloat64() (*TypeRepresentationFloat64, error)
- func (ty TypeRepresentation) AsGeography() (*TypeRepresentationGeography, error)
- func (ty TypeRepresentation) AsGeometry() (*TypeRepresentationGeometry, error)
- func (ty TypeRepresentation) AsInt16() (*TypeRepresentationInt16, error)
- func (ty TypeRepresentation) AsInt32() (*TypeRepresentationInt32, error)
- func (ty TypeRepresentation) AsInt64() (*TypeRepresentationInt64, error)
- func (ty TypeRepresentation) AsInt8() (*TypeRepresentationInt8, error)
- func (ty TypeRepresentation) AsInteger() (*TypeRepresentationInteger, error)deprecated
- func (ty TypeRepresentation) AsJSON() (*TypeRepresentationJSON, error)
- func (ty TypeRepresentation) AsNumber() (*TypeRepresentationNumber, error)deprecated
- func (ty TypeRepresentation) AsString() (*TypeRepresentationString, error)
- func (ty TypeRepresentation) AsTimestamp() (*TypeRepresentationTimestamp, error)
- func (ty TypeRepresentation) AsTimestampTZ() (*TypeRepresentationTimestampTZ, error)
- func (ty TypeRepresentation) AsUUID() (*TypeRepresentationUUID, error)
- func (ty TypeRepresentation) Interface() TypeRepresentationEncoder
- func (ty TypeRepresentation) InterfaceT() (TypeRepresentationEncoder, error)
- func (ty TypeRepresentation) Type() (TypeRepresentationType, error)
- func (j *TypeRepresentation) UnmarshalJSON(b []byte) error
- type TypeRepresentationBigDecimal
- type TypeRepresentationBigInteger
- type TypeRepresentationBoolean
- type TypeRepresentationBytes
- type TypeRepresentationDate
- type TypeRepresentationEncoder
- type TypeRepresentationEnum
- type TypeRepresentationFloat32
- type TypeRepresentationFloat64
- type TypeRepresentationGeography
- type TypeRepresentationGeometry
- type TypeRepresentationInt16
- type TypeRepresentationInt32
- type TypeRepresentationInt64
- type TypeRepresentationInt8
- type TypeRepresentationIntegerdeprecated
- type TypeRepresentationJSON
- type TypeRepresentationNumberdeprecated
- type TypeRepresentationString
- type TypeRepresentationTimestamp
- type TypeRepresentationTimestampTZ
- type TypeRepresentationType
- type TypeRepresentationUUID
- type UnaryComparisonOperator
- type UniquenessConstraint
- type ValidateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregate ¶
Aggregate represents an aggregated query object
func (Aggregate) AsColumnCount ¶
func (j Aggregate) AsColumnCount() (*AggregateColumnCount, error)
AsColumnCount tries to convert the instance to AggregateColumnCount type
func (Aggregate) AsSingleColumn ¶
func (j Aggregate) AsSingleColumn() (*AggregateSingleColumn, error)
AsSingleColumn tries to convert the instance to AggregateSingleColumn type
func (Aggregate) AsStarCount ¶
func (j Aggregate) AsStarCount() (*AggregateStarCount, error)
AsStarCount tries to convert the instance to AggregateStarCount type
func (Aggregate) Interface ¶
func (j Aggregate) Interface() AggregateEncoder
Interface tries to convert the instance to AggregateEncoder interface
func (Aggregate) InterfaceT ¶
func (j Aggregate) InterfaceT() (AggregateEncoder, error)
InterfaceT tries to convert the instance to AggregateEncoder interface safely with explicit error
func (Aggregate) Type ¶
func (j Aggregate) Type() (AggregateType, error)
Type gets the type enum of the current type
func (*Aggregate) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type AggregateColumnCount ¶
type AggregateColumnCount struct { Type AggregateType `json:"type" yaml:"type" mapstructure:"type"` // The column to apply the aggregation function to Column string `json:"column" yaml:"column" mapstructure:"column"` // Whether or not only distinct items should be counted. Distinct bool `json:"distinct" yaml:"distinct" mapstructure:"distinct"` // Path to a nested field within an object column. FieldPath []string `json:"field_path,omitempty" yaml:"field_path,omitempty" mapstructure:"field_path"` }
AggregateColumnCount represents an aggregate object which count the number of rows with non-null values in the specified columns. If the distinct flag is set, then the count should only count unique non-null values of those columns.
func NewAggregateColumnCount ¶
func NewAggregateColumnCount(column string, distinct bool, fieldPath []string) *AggregateColumnCount
NewAggregateColumnCount creates a new AggregateColumnCount instance
func (AggregateColumnCount) Encode ¶
func (ag AggregateColumnCount) Encode() Aggregate
Encode converts the instance to raw Aggregate
type AggregateEncoder ¶
type AggregateEncoder interface {
Encode() Aggregate
}
AggregateEncoder abstracts the serialization interface for Aggregate
type AggregateFunctionDefinition ¶
type AggregateFunctionDefinition struct { // The scalar or object type of the result of this function ResultType Type `json:"result_type" yaml:"result_type" mapstructure:"result_type"` }
The definition of an aggregation function on a scalar type
func (*AggregateFunctionDefinition) UnmarshalJSON ¶
func (j *AggregateFunctionDefinition) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type AggregateSingleColumn ¶
type AggregateSingleColumn struct { Type AggregateType `json:"type" yaml:"type" mapstructure:"type"` // The column to apply the aggregation function to Column string `json:"column" yaml:"column" mapstructure:"column"` // Single column aggregate function name. Function string `json:"function" yaml:"function" mapstructure:"function"` // Path to a nested field within an object column. FieldPath []string `json:"field_path,omitempty" yaml:"field_path,omitempty" mapstructure:"field_path"` }
AggregateSingleColumn represents an aggregate object which applies an aggregation function (as defined by the column's scalar type in the schema response) to a column.
func NewAggregateSingleColumn ¶
func NewAggregateSingleColumn(column string, function string, fieldPath []string) *AggregateSingleColumn
NewAggregateSingleColumn creates a new AggregateSingleColumn instance
func (AggregateSingleColumn) Encode ¶
func (ag AggregateSingleColumn) Encode() Aggregate
Encode converts the instance to raw Aggregate
type AggregateStarCount ¶
type AggregateStarCount struct {
Type AggregateType `json:"type" mapstructure:"type"`
}
AggregateStarCount represents an aggregate object which counts all matched rows
func NewAggregateStarCount ¶
func NewAggregateStarCount() *AggregateStarCount
NewAggregateStarCount creates a new AggregateStarCount instance
func (AggregateStarCount) Encode ¶
func (ag AggregateStarCount) Encode() Aggregate
Encode converts the instance to raw Aggregate
type AggregateType ¶
type AggregateType string
AggregateType represents an aggregate type
const ( // AggregateTypeColumnCount aggregates count the number of rows with non-null values in the specified columns. // If the distinct flag is set, then the count should only count unique non-null values of those columns, AggregateTypeColumnCount AggregateType = "column_count" // AggregateTypeSingleColumn aggregates apply an aggregation function (as defined by the column's scalar type in the schema response) to a column AggregateTypeSingleColumn AggregateType = "single_column" // AggregateTypeStarCount aggregates count all matched rows AggregateTypeStarCount AggregateType = "star_count" )
func ParseAggregateType ¶
func ParseAggregateType(input string) (AggregateType, error)
ParseAggregateType parses an aggregate type argument type from string
func (AggregateType) IsValid ¶ added in v0.3.1
func (j AggregateType) IsValid() bool
IsValid checks if the value is invalid
func (*AggregateType) UnmarshalJSON ¶
func (j *AggregateType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Argument ¶
type Argument struct { Type ArgumentType `json:"type" yaml:"type" mapstructure:"type"` Name string `json:"name" yaml:"name" mapstructure:"name"` Value any `json:"value" yaml:"value" mapstructure:"value"` }
Argument is provided by reference to a variable or as a literal value
TODO: may change Argument to a generic map in the future
func NewLiteralArgument
deprecated
added in
v0.3.1
NewLiteralArgument creates an argument with a literal value
Deprecated: use NewArgumentLiteral instead
func NewVariableArgument
deprecated
added in
v0.3.1
NewVariableArgument creates an argument with a variable name
Deprecated: use NewArgumentVariable instead
func (Argument) AsLiteral ¶ added in v0.3.1
func (j Argument) AsLiteral() (*ArgumentLiteral, error)
AsLiteral converts the instance to ArgumentLiteral
func (Argument) AsVariable ¶ added in v0.3.1
func (j Argument) AsVariable() (*ArgumentVariable, error)
AsVariable converts the instance to ArgumentVariable
func (Argument) Interface ¶ added in v0.3.1
func (j Argument) Interface() ArgumentEncoder
Interface converts the comparison value to its generic interface
func (Argument) InterfaceT ¶ added in v0.3.1
func (j Argument) InterfaceT() (ArgumentEncoder, error)
InterfaceT converts the comparison value to its generic interface safely with explicit error
func (Argument) MarshalJSON ¶ added in v0.3.1
MarshalJSON implements json.Marshaler.
func (*Argument) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type ArgumentEncoder ¶ added in v0.3.1
type ArgumentEncoder interface {
Encode() Argument
}
ArgumentEncoder abstracts the interface for Argument
type ArgumentInfo ¶
type ArgumentInfo struct { // Argument description Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"` // The name of the type of this argument Type Type `json:"type" yaml:"type" mapstructure:"type"` }
func (*ArgumentInfo) UnmarshalJSON ¶
func (j *ArgumentInfo) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ArgumentLiteral ¶ added in v0.3.1
type ArgumentLiteral struct { Type ArgumentType `json:"type" yaml:"type" mapstructure:"type"` Value any `json:"value" yaml:"value" mapstructure:"value"` }
ArgumentLiteral represents the literal argument
func NewArgumentLiteral ¶ added in v0.3.1
func NewArgumentLiteral(value any) *ArgumentLiteral
NewArgumentLiteral creates an argument with a literal value
func (ArgumentLiteral) Encode ¶ added in v0.3.1
func (j ArgumentLiteral) Encode() Argument
Encode converts the instance to raw Field
type ArgumentType ¶
type ArgumentType string
ArgumentType represents an argument type enum
const ( ArgumentTypeLiteral ArgumentType = "literal" ArgumentTypeVariable ArgumentType = "variable" )
func ParseArgumentType ¶
func ParseArgumentType(input string) (ArgumentType, error)
ParseArgumentType parses an argument type from string
func (ArgumentType) IsValid ¶ added in v0.3.1
func (j ArgumentType) IsValid() bool
IsValid checks if the value is invalid
func (*ArgumentType) UnmarshalJSON ¶
func (j *ArgumentType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ArgumentVariable ¶ added in v0.3.1
type ArgumentVariable struct { Type ArgumentType `json:"type" yaml:"type" mapstructure:"type"` Name string `json:"name" yaml:"name" mapstructure:"name"` }
ArgumentVariable represents the variable argument
func NewArgumentVariable ¶ added in v0.3.1
func NewArgumentVariable(name string) *ArgumentVariable
NewArgumentVariable creates an argument with a variable name
func (ArgumentVariable) Encode ¶ added in v0.3.1
func (j ArgumentVariable) Encode() Argument
Encode converts the instance to raw Field
type ArrayType ¶
type ArrayType struct { Type TypeEnum `json:"type" yaml:"type" mapstructure:"type"` // The type of the elements of the array ElementType Type `json:"element_type" yaml:"element_type" mapstructure:"element_type"` }
ArrayType represents an array type
func NewArrayType ¶
func NewArrayType(elementType TypeEncoder) *ArrayType
NewArrayType creates a new ArrayType instance
type Capabilities ¶
type Capabilities struct { // Mutation corresponds to the JSON schema field "mutation". Mutation MutationCapabilities `json:"mutation" yaml:"mutation" mapstructure:"mutation"` // Query corresponds to the JSON schema field "query". Query QueryCapabilities `json:"query" yaml:"query" mapstructure:"query"` // Relationships corresponds to the JSON schema field "relationships". Relationships interface{} `json:"relationships,omitempty" yaml:"relationships,omitempty" mapstructure:"relationships,omitempty"` }
Describes the features of the specification which a data connector implements.
func (*Capabilities) UnmarshalJSON ¶
func (j *Capabilities) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CapabilitiesResponse ¶
type CapabilitiesResponse struct { // Capabilities corresponds to the JSON schema field "capabilities". Capabilities Capabilities `json:"capabilities" yaml:"capabilities" mapstructure:"capabilities"` // Version corresponds to the JSON schema field "version". Version string `json:"version" yaml:"version" mapstructure:"version"` }
func (CapabilitiesResponse) MarshalCapabilitiesJSON ¶ added in v0.2.0
func (j CapabilitiesResponse) MarshalCapabilitiesJSON() ([]byte, error)
MarshalCapabilitiesJSON encodes the NDC schema response to JSON
func (*CapabilitiesResponse) UnmarshalJSON ¶
func (j *CapabilitiesResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CapabilitiesResponseMarshaler ¶ added in v0.2.0
CapabilitiesResponseMarshaler abstract the response for /capabilities handler
type CollectionInfo ¶
type CollectionInfo struct { // Any arguments that this collection requires Arguments CollectionInfoArguments `json:"arguments" yaml:"arguments" mapstructure:"arguments"` // Description of the collection Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"` // Any foreign key constraints enforced on this collection ForeignKeys CollectionInfoForeignKeys `json:"foreign_keys" yaml:"foreign_keys" mapstructure:"foreign_keys"` // The name of the collection // // Note: these names are abstract - there is no requirement that this name // correspond to the name of an actual collection in the database. Name string `json:"name" yaml:"name" mapstructure:"name"` // The name of the collection's object type Type string `json:"type" yaml:"type" mapstructure:"type"` // Any uniqueness constraints enforced on this collection UniquenessConstraints CollectionInfoUniquenessConstraints `json:"uniqueness_constraints" yaml:"uniqueness_constraints" mapstructure:"uniqueness_constraints"` }
func (*CollectionInfo) UnmarshalJSON ¶
func (j *CollectionInfo) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CollectionInfoArguments ¶
type CollectionInfoArguments map[string]ArgumentInfo
Any arguments that this collection requires
type CollectionInfoForeignKeys ¶
type CollectionInfoForeignKeys map[string]ForeignKeyConstraint
Any foreign key constraints enforced on this collection
type CollectionInfoUniquenessConstraints ¶
type CollectionInfoUniquenessConstraints map[string]UniquenessConstraint
Any uniqueness constraints enforced on this collection
type ColumnField ¶
type ColumnField struct { Type FieldType `json:"type" yaml:"type" mapstructure:"type"` // Column name Column string `json:"column" yaml:"column" mapstructure:"column"` // When the type of the column is a (possibly-nullable) array or object, // the caller can request a subset of the complete column data, by specifying fields to fetch here. // If omitted, the column data will be fetched in full. Fields NestedField `json:"fields,omitempty" yaml:"fields,omitempty" mapstructure:"fields"` Arguments map[string]Argument `json:"arguments,omitempty" yaml:"arguments,omitempty" mapstructure:"fields"` }
ColumnField represents a column field
func NewColumnField ¶
func NewColumnField(column string, fields NestedFieldEncoder) *ColumnField
NewColumnField creates a new ColumnField instance
func NewColumnFieldWithArguments ¶ added in v0.3.1
func NewColumnFieldWithArguments(column string, fields NestedFieldEncoder, arguments map[string]Argument) *ColumnField
NewColumnFieldWithArguments creates a new ColumnField instance with arguments
func (ColumnField) Encode ¶
func (f ColumnField) Encode() Field
Encode converts the instance to raw Field
type ComparisonOperatorCustom ¶
type ComparisonOperatorCustom struct { Type ComparisonOperatorDefinitionType `json:"type" yaml:"type" mapstructure:"type"` // The type of the argument to this operator ArgumentType Type `json:"argument_type" yaml:"argument_type" mapstructure:"argument_type"` }
ComparisonOperatorCustom presents a custom comparison operator
func NewComparisonOperatorCustom ¶
func NewComparisonOperatorCustom(argumentType TypeEncoder) *ComparisonOperatorCustom
NewComparisonOperatorCustom create a new ComparisonOperatorCustom instance
func (ComparisonOperatorCustom) Encode ¶
func (ob ComparisonOperatorCustom) Encode() ComparisonOperatorDefinition
Encode converts the instance to raw ComparisonOperatorDefinition
type ComparisonOperatorDefinition ¶
ComparisonOperatorDefinition the definition of a comparison operator on a scalar type
func (ComparisonOperatorDefinition) AsCustom ¶
func (j ComparisonOperatorDefinition) AsCustom() (*ComparisonOperatorCustom, error)
AsCustom tries to convert the instance to ComparisonOperatorIn type
func (ComparisonOperatorDefinition) AsEqual ¶
func (j ComparisonOperatorDefinition) AsEqual() (*ComparisonOperatorEqual, error)
AsEqual tries to convert the instance to ComparisonOperatorEqual type
func (ComparisonOperatorDefinition) AsIn ¶
func (j ComparisonOperatorDefinition) AsIn() (*ComparisonOperatorIn, error)
AsIn tries to convert the instance to ComparisonOperatorIn type
func (ComparisonOperatorDefinition) Interface ¶
func (j ComparisonOperatorDefinition) Interface() ComparisonOperatorDefinitionEncoder
Interface tries to convert the instance to ComparisonOperatorDefinitionEncoder interface
func (ComparisonOperatorDefinition) InterfaceT ¶
func (j ComparisonOperatorDefinition) InterfaceT() (ComparisonOperatorDefinitionEncoder, error)
InterfaceT tries to convert the instance to ComparisonOperatorDefinitionEncoder interface safely with explicit error
func (ComparisonOperatorDefinition) Type ¶
func (j ComparisonOperatorDefinition) Type() (ComparisonOperatorDefinitionType, error)
Type gets the type enum of the current type
func (*ComparisonOperatorDefinition) UnmarshalJSON ¶
func (j *ComparisonOperatorDefinition) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ComparisonOperatorDefinitionEncoder ¶
type ComparisonOperatorDefinitionEncoder interface {
Encode() ComparisonOperatorDefinition
}
ComparisonOperatorDefinitionEncoder abstracts the serialization interface for ComparisonOperatorDefinition
type ComparisonOperatorDefinitionType ¶
type ComparisonOperatorDefinitionType string
ComparisonOperatorDefinitionType represents a binary comparison operator type enum
const ( ComparisonOperatorDefinitionTypeEqual ComparisonOperatorDefinitionType = "equal" ComparisonOperatorDefinitionTypeIn ComparisonOperatorDefinitionType = "in" ComparisonOperatorDefinitionTypeCustom ComparisonOperatorDefinitionType = "custom" )
func ParseComparisonOperatorDefinitionType ¶
func ParseComparisonOperatorDefinitionType(input string) (ComparisonOperatorDefinitionType, error)
ParseComparisonOperatorDefinitionType parses a type of a comparison operator definition
func (ComparisonOperatorDefinitionType) IsValid ¶ added in v0.3.1
func (j ComparisonOperatorDefinitionType) IsValid() bool
IsValid checks if the value is invalid
func (*ComparisonOperatorDefinitionType) UnmarshalJSON ¶
func (j *ComparisonOperatorDefinitionType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ComparisonOperatorEqual ¶
type ComparisonOperatorEqual struct {
Type ComparisonOperatorDefinitionType `json:"type" yaml:"type" mapstructure:"type"`
}
ComparisonOperatorEqual presents an equal comparison operator
func NewComparisonOperatorEqual ¶
func NewComparisonOperatorEqual() *ComparisonOperatorEqual
NewComparisonOperatorEqual create a new ComparisonOperatorEqual instance
func (ComparisonOperatorEqual) Encode ¶
func (ob ComparisonOperatorEqual) Encode() ComparisonOperatorDefinition
Encode converts the instance to raw ComparisonOperatorDefinition
type ComparisonOperatorIn ¶
type ComparisonOperatorIn struct {
Type ComparisonOperatorDefinitionType `json:"type" yaml:"type" mapstructure:"type"`
}
ComparisonOperatorIn presents an in comparison operator
func NewComparisonOperatorIn ¶
func NewComparisonOperatorIn() *ComparisonOperatorIn
NewComparisonOperatorIn create a new ComparisonOperatorIn instance
func (ComparisonOperatorIn) Encode ¶
func (ob ComparisonOperatorIn) Encode() ComparisonOperatorDefinition
Encode converts the instance to raw ComparisonOperatorDefinition
type ComparisonTarget ¶
type ComparisonTarget struct { Type ComparisonTargetType `json:"type" yaml:"type" mapstructure:"type"` Name string `json:"name" yaml:"name" mapstructure:"name"` Path []PathElement `json:"path,omitempty" yaml:"path,omitempty" mapstructure:"path"` FieldPath []string `json:"field_path,omitempty" yaml:"field_path,omitempty" mapstructure:"field_path"` }
ComparisonTarget represents a comparison target object
func NewComparisonTargetColumn ¶ added in v0.3.1
func NewComparisonTargetColumn(name string, fieldPath []string, path []PathElement) *ComparisonTarget
NewComparisonTargetColumn creates a ComparisonTarget with column type
func NewComparisonTargetRootCollectionColumn ¶ added in v0.3.1
func NewComparisonTargetRootCollectionColumn(name string, fieldPath []string) *ComparisonTarget
NewComparisonTargetRootCollectionColumn creates a ComparisonTarget with root_collection_column type
type ComparisonTargetType ¶
type ComparisonTargetType string
ComparisonTargetType represents comparison target enums
const ( ComparisonTargetTypeColumn ComparisonTargetType = "column" ComparisonTargetTypeRootCollectionColumn ComparisonTargetType = "root_collection_column" )
func ParseComparisonTargetType ¶
func ParseComparisonTargetType(input string) (ComparisonTargetType, error)
ParseComparisonTargetType parses a comparison target type argument type from string
func (ComparisonTargetType) IsValid ¶ added in v0.3.1
func (j ComparisonTargetType) IsValid() bool
IsValid checks if the value is invalid
func (*ComparisonTargetType) UnmarshalJSON ¶
func (j *ComparisonTargetType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ComparisonValue ¶
ComparisonValue represents a raw comparison value object with validation
func (ComparisonValue) AsColumn ¶
func (cv ComparisonValue) AsColumn() (*ComparisonValueColumn, error)
AsColumn tries to convert the comparison value to column
func (ComparisonValue) AsScalar ¶
func (cv ComparisonValue) AsScalar() (*ComparisonValueScalar, error)
AsScalar tries to convert the comparison value to scalar
func (ComparisonValue) AsVariable ¶
func (cv ComparisonValue) AsVariable() (*ComparisonValueVariable, error)
AsVariable tries to convert the comparison value to column
func (ComparisonValue) Interface ¶
func (cv ComparisonValue) Interface() ComparisonValueEncoder
Interface converts the comparison value to its generic interface
func (ComparisonValue) InterfaceT ¶
func (cv ComparisonValue) InterfaceT() (ComparisonValueEncoder, error)
InterfaceT converts the comparison value to its generic interface safely with explicit error
func (ComparisonValue) Type ¶
func (cv ComparisonValue) Type() (ComparisonValueType, error)
GetType gets the type of comparison value
func (*ComparisonValue) UnmarshalJSON ¶
func (j *ComparisonValue) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ComparisonValueColumn ¶
type ComparisonValueColumn struct { Type ComparisonValueType `json:"type" yaml:"type" mapstructure:"type"` Column ComparisonTarget `json:"column" yaml:"column" mapstructure:"column"` }
ComparisonValueColumn represents a comparison value with column type
func NewComparisonValueColumn ¶ added in v0.3.1
func NewComparisonValueColumn(column ComparisonTarget) *ComparisonValueColumn
NewComparisonValueColumn creates a new ComparisonValueColumn instance
func (ComparisonValueColumn) Encode ¶
func (cv ComparisonValueColumn) Encode() ComparisonValue
Encode converts to the raw comparison value
type ComparisonValueEncoder ¶
type ComparisonValueEncoder interface {
Encode() ComparisonValue
}
ComparisonValueEncoder represents a comparison value encoder interface
type ComparisonValueScalar ¶
type ComparisonValueScalar struct { Type ComparisonValueType `json:"type" yaml:"type" mapstructure:"type"` Value any `json:"value" yaml:"value" mapstructure:"value"` }
ComparisonValueScalar represents a comparison value with scalar type
func NewComparisonValueScalar ¶ added in v0.3.1
func NewComparisonValueScalar(value any) *ComparisonValueScalar
NewComparisonValueScalar creates a new ComparisonValueScalar instance
func (ComparisonValueScalar) Encode ¶
func (cv ComparisonValueScalar) Encode() ComparisonValue
Encode converts to the raw comparison value
type ComparisonValueType ¶
type ComparisonValueType string
ComparisonValueType represents a comparison value type enum
const ( ComparisonValueTypeColumn ComparisonValueType = "column" ComparisonValueTypeScalar ComparisonValueType = "scalar" ComparisonValueTypeVariable ComparisonValueType = "variable" )
func ParseComparisonValueType ¶
func ParseComparisonValueType(input string) (ComparisonValueType, error)
ParseComparisonValueType parses a comparison value type from string
func (ComparisonValueType) IsValid ¶ added in v0.3.1
func (j ComparisonValueType) IsValid() bool
IsValid checks if the value is invalid
func (*ComparisonValueType) UnmarshalJSON ¶
func (j *ComparisonValueType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ComparisonValueVariable ¶
type ComparisonValueVariable struct { Type ComparisonValueType `json:"type" yaml:"type" mapstructure:"type"` Name string `json:"name" yaml:"name" mapstructure:"name"` }
ComparisonValueVariable represents a comparison value with variable type
func NewComparisonValueVariable ¶ added in v0.3.1
func NewComparisonValueVariable(name string) *ComparisonValueVariable
NewComparisonValueVariable creates a new ComparisonValueVariable instance
func (ComparisonValueVariable) Encode ¶
func (cv ComparisonValueVariable) Encode() ComparisonValue
Encode converts to the raw comparison value
type ConnectorError ¶
type ConnectorError struct { // A human-readable summary of the error Message string `json:"message" yaml:"message" mapstructure:"message"` // Any additional structured information about the error Details map[string]any `json:"details" yaml:"details" mapstructure:"details"` // contains filtered or unexported fields }
ConnectorError represents a connector error that follows NDC error handling specs
func BadGatewayError ¶
func BadGatewayError(message string, details map[string]any) *ConnectorError
BadGatewayError returns an error when the request could not be handled because an upstream service was unavailable or returned an unexpected response, e.g., a connection to a database server failed
func BadRequestError ¶
func BadRequestError(message string, details map[string]any) *ConnectorError
BadRequestError returns an error when the request did not match the data connector's expectation based on this specification
func ConflictError ¶
func ConflictError(message string, details map[string]any) *ConnectorError
ConflictError returns an error when the request could not be handled because it would create a conflicting state for the data source, for example, a mutation might fail because a foreign key constraint was not met
func ForbiddenError ¶
func ForbiddenError(message string, details map[string]any) *ConnectorError
ForbiddenError returns an error when the request could not be handled because a permission check failed, for example, a mutation might fail because a check constraint was not met
func InternalServerError ¶
func InternalServerError(message string, details map[string]any) *ConnectorError
InternalServerError returns an error when the request could not be handled because of an error on the server
func NewConnectorError ¶
func NewConnectorError(statusCode int, message string, details map[string]any) *ConnectorError
NewConnectorError creates a ConnectorError instance
func NotSupportedError ¶
func NotSupportedError(message string, details map[string]any) *ConnectorError
NotSupportedError returns an error when the request could not be handled because it relies on an unsupported capability. Note: this ought to indicate an error on the caller side, since the caller should not generate requests which are incompatible with the indicated capabilities
func UnauthorizeError ¶
func UnauthorizeError(message string, details map[string]any) *ConnectorError
UnauthorizeError returns an unauthorized error.
func UnprocessableContentError ¶
func UnprocessableContentError(message string, details map[string]any) *ConnectorError
UnprocessableContentError returns an error when the request could not be handled because, while the request was well-formed, it was not semantically correct. For example, a value for a custom scalar type was provided, but with an incorrect type.
func (ConnectorError) Error ¶
func (ce ConnectorError) Error() string
Error implements the Error interface
func (ConnectorError) StatusCode ¶
func (ce ConnectorError) StatusCode() int
StatusCode gets the inner status code
func (ConnectorError) String ¶
func (ce ConnectorError) String() string
String implements the Stringer interface
type ErrorResponse ¶
type ErrorResponse struct { // Any additional structured information about the error Details interface{} `json:"details" yaml:"details" mapstructure:"details"` // A human-readable summary of the error Message string `json:"message" yaml:"message" mapstructure:"message"` }
func (ErrorResponse) Error ¶
func (ce ErrorResponse) Error() string
Error implements the Error interface
func (ErrorResponse) String ¶
func (ce ErrorResponse) String() string
String implements the Stringer interface
func (*ErrorResponse) UnmarshalJSON ¶
func (j *ErrorResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ExistsCapabilities ¶ added in v0.3.1
type ExistsCapabilities struct {
// Does the connector support ExistsInCollection::NestedCollection
NestedCollections interface{} `json:"nested_collections,omitempty" yaml:"nested_collections,omitempty" mapstructure:"nested_collections,omitempty"`
}
type ExistsInCollection ¶
ExistsInCollection represents an Exists In Collection object
func (ExistsInCollection) AsNestedCollection ¶ added in v0.3.1
func (j ExistsInCollection) AsNestedCollection() (*ExistsInCollectionNestedCollection, error)
AsNestedCollection tries to convert the instance to nested_collection type
func (ExistsInCollection) AsRelated ¶
func (j ExistsInCollection) AsRelated() (*ExistsInCollectionRelated, error)
AsRelated tries to convert the instance to related type
func (ExistsInCollection) AsUnrelated ¶
func (j ExistsInCollection) AsUnrelated() (*ExistsInCollectionUnrelated, error)
AsRelated tries to convert the instance to unrelated type
func (ExistsInCollection) Interface ¶
func (j ExistsInCollection) Interface() ExistsInCollectionEncoder
Interface tries to convert the instance to the ExistsInCollectionEncoder interface
func (ExistsInCollection) InterfaceT ¶
func (j ExistsInCollection) InterfaceT() (ExistsInCollectionEncoder, error)
InterfaceT tries to convert the instance to the ExistsInCollectionEncoder interface safely with explicit error
func (ExistsInCollection) Type ¶
func (j ExistsInCollection) Type() (ExistsInCollectionType, error)
Type gets the type enum of the current type
func (*ExistsInCollection) UnmarshalJSON ¶
func (j *ExistsInCollection) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ExistsInCollectionEncoder ¶
type ExistsInCollectionEncoder interface {
Encode() ExistsInCollection
}
ExistsInCollectionEncoder abstracts the ExistsInCollection serialization interface
type ExistsInCollectionNestedCollection ¶ added in v0.3.1
type ExistsInCollectionNestedCollection struct { Type ExistsInCollectionType `json:"type" yaml:"type" mapstructure:"type"` // The name of column ColumnName string `json:"column_name" yaml:"column_name" mapstructure:"column_name"` // Values to be provided to any collection arguments Arguments map[string]RelationshipArgument `json:"arguments,omitempty" yaml:"arguments,omitempty" mapstructure:"arguments"` // Path to a nested collection via object columns FieldPath []string `json:"field_path,omitempty" yaml:"field_path,omitempty" mapstructure:"field_path"` }
ExistsInCollectionNestedCollection represents nested collections expression.
func NewExistsInCollectionNestedCollection ¶ added in v0.3.1
func NewExistsInCollectionNestedCollection(columnName string, arguments map[string]RelationshipArgument, fieldPath []string) *ExistsInCollectionNestedCollection
NewExistsInCollectionNestedCollection creates an ExistsInCollectionNestedCollection instance
func (ExistsInCollectionNestedCollection) Encode ¶ added in v0.3.1
func (ei ExistsInCollectionNestedCollection) Encode() ExistsInCollection
Encode converts the instance to its raw type
type ExistsInCollectionRelated ¶
type ExistsInCollectionRelated struct { Type ExistsInCollectionType `json:"type" yaml:"type" mapstructure:"type"` Relationship string `json:"relationship" yaml:"relationship" mapstructure:"relationship"` // Values to be provided to any collection arguments Arguments map[string]RelationshipArgument `json:"arguments" yaml:"arguments" mapstructure:"arguments"` }
ExistsInCollectionRelated represents Related collections that are related to the original collection by a relationship in the collection_relationships field of the top-level QueryRequest.
func NewExistsInCollectionRelated ¶ added in v0.3.1
func NewExistsInCollectionRelated(relationship string, arguments map[string]RelationshipArgument) *ExistsInCollectionRelated
NewExistsInCollectionRelated creates an ExistsInCollectionRelated instance
func (ExistsInCollectionRelated) Encode ¶
func (ei ExistsInCollectionRelated) Encode() ExistsInCollection
Encode converts the instance to its raw type
type ExistsInCollectionType ¶
type ExistsInCollectionType string
ExistsInCollectionType represents an exists in collection type enum
const ( ExistsInCollectionTypeRelated ExistsInCollectionType = "related" ExistsInCollectionTypeNestedCollection ExistsInCollectionType = "nested_collection" )
func ParseExistsInCollectionType ¶
func ParseExistsInCollectionType(input string) (ExistsInCollectionType, error)
ParseExistsInCollectionType parses a comparison value type from string
func (ExistsInCollectionType) IsValid ¶ added in v0.3.1
func (j ExistsInCollectionType) IsValid() bool
IsValid checks if the value is invalid
func (*ExistsInCollectionType) UnmarshalJSON ¶
func (j *ExistsInCollectionType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ExistsInCollectionUnrelated ¶
type ExistsInCollectionUnrelated struct { string `json:"collection" yaml:"collection" mapstructure:"collection"` Arguments map[string]RelationshipArgument `json:"arguments" yaml:"arguments" mapstructure:"arguments"` }Collection
ExistsInCollectionUnrelated represents unrelated collections.
func NewExistsInCollectionUnrelated ¶ added in v0.3.1
func NewExistsInCollectionUnrelated(collection string, arguments map[string]RelationshipArgument) *ExistsInCollectionUnrelated
NewExistsInCollectionUnrelated creates an ExistsInCollectionUnrelated instance
func (ExistsInCollectionUnrelated) Encode ¶
func (ei ExistsInCollectionUnrelated) Encode() ExistsInCollection
Encode converts the instance to its raw type
type ExplainResponse ¶
type ExplainResponse struct { // A list of human-readable key-value pairs describing a query execution plan. For // example, a connector for a relational database might return the generated SQL // and/or the output of the `EXPLAIN` command. An API-based connector might encode // a list of statically-known API calls which would be made. Details ExplainResponseDetails `json:"details" yaml:"details" mapstructure:"details"` }
func (*ExplainResponse) UnmarshalJSON ¶
func (j *ExplainResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ExplainResponseDetails ¶
A list of human-readable key-value pairs describing a query execution plan. For example, a connector for a relational database might return the generated SQL and/or the output of the `EXPLAIN` command. An API-based connector might encode a list of statically-known API calls which would be made.
type Expression ¶
Expression represents the query expression object
func (Expression) AsAnd ¶
func (j Expression) AsAnd() (*ExpressionAnd, error)
AsAnd tries to convert the instance to and type
func (Expression) AsBinaryComparisonOperator ¶
func (j Expression) AsBinaryComparisonOperator() (*ExpressionBinaryComparisonOperator, error)
AsBinaryComparisonOperator tries to convert the instance to ExpressionBinaryComparisonOperator instance
func (Expression) AsExists ¶
func (j Expression) AsExists() (*ExpressionExists, error)
AsExists tries to convert the instance to ExpressionExists instance
func (Expression) AsNot ¶
func (j Expression) AsNot() (*ExpressionNot, error)
AsNot tries to convert the instance to ExpressionNot instance
func (Expression) AsOr ¶
func (j Expression) AsOr() (*ExpressionOr, error)
AsOr tries to convert the instance to ExpressionOr instance
func (Expression) AsUnaryComparisonOperator ¶
func (j Expression) AsUnaryComparisonOperator() (*ExpressionUnaryComparisonOperator, error)
AsUnaryComparisonOperator tries to convert the instance to ExpressionUnaryComparisonOperator instance
func (Expression) Interface ¶
func (j Expression) Interface() ExpressionEncoder
Interface tries to convert the instance to the ExpressionEncoder interface
func (Expression) InterfaceT ¶
func (j Expression) InterfaceT() (ExpressionEncoder, error)
InterfaceT tries to convert the instance to the ExpressionEncoder interface safely with explicit error
func (Expression) Type ¶
func (j Expression) Type() (ExpressionType, error)
Type gets the type enum of the current type
func (*Expression) UnmarshalJSON ¶
func (j *Expression) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ExpressionAnd ¶
type ExpressionAnd struct { Type ExpressionType `json:"type" yaml:"type" mapstructure:"type"` Expressions []Expression `json:"expressions" yaml:"expressions" mapstructure:"expressions"` }
ExpressionAnd is an object which represents the conjunction of expressions
func NewExpressionAnd ¶ added in v0.3.1
func NewExpressionAnd(expressions ...ExpressionEncoder) *ExpressionAnd
NewExpressionAnd creates an ExpressionAnd instance
func (ExpressionAnd) Encode ¶
func (exp ExpressionAnd) Encode() Expression
Encode converts the instance to a raw Expression
type ExpressionBinaryComparisonOperator ¶
type ExpressionBinaryComparisonOperator struct { Type ExpressionType `json:"type" yaml:"type" mapstructure:"type"` Operator string `json:"operator" yaml:"operator" mapstructure:"operator"` Column ComparisonTarget `json:"column" yaml:"column" mapstructure:"column"` Value ComparisonValue `json:"value" yaml:"value" mapstructure:"value"` }
ExpressionBinaryComparisonOperator is an object which represents an binary operator expression
func NewExpressionBinaryComparisonOperator ¶ added in v0.3.1
func NewExpressionBinaryComparisonOperator(column ComparisonTarget, operator string, value ComparisonValueEncoder) *ExpressionBinaryComparisonOperator
NewExpressionBinaryComparisonOperator creates an ExpressionBinaryComparisonOperator instance
func (ExpressionBinaryComparisonOperator) Encode ¶
func (exp ExpressionBinaryComparisonOperator) Encode() Expression
Encode converts the instance to a raw Expression
type ExpressionEncoder ¶
type ExpressionEncoder interface {
Encode() Expression
}
ExpressionEncoder abstracts the expression encoder interface
type ExpressionExists ¶
type ExpressionExists struct { Type ExpressionType `json:"type" yaml:"type" mapstructure:"type"` Predicate Expression `json:"predicate" yaml:"predicate" mapstructure:"predicate"` InCollection ExistsInCollection `json:"in_collection" yaml:"in_collection" mapstructure:"in_collection"` }
ExpressionExists is an object which represents an EXISTS expression
func NewExpressionExists ¶ added in v0.3.1
func NewExpressionExists(predicate ExpressionEncoder, inCollection ExistsInCollectionEncoder) *ExpressionExists
NewExpressionExists creates an ExpressionExists instance
func (ExpressionExists) Encode ¶
func (exp ExpressionExists) Encode() Expression
Encode converts the instance to a raw Expression
type ExpressionNot ¶
type ExpressionNot struct { Type ExpressionType `json:"type" yaml:"type" mapstructure:"type"` Expression Expression `json:"expression" yaml:"expression" mapstructure:"expression"` }
ExpressionNot is an object which represents the negation of an expression
func NewExpressionNot ¶ added in v0.3.1
func NewExpressionNot(expression ExpressionEncoder) *ExpressionNot
NewExpressionNot creates an ExpressionNot instance
func (ExpressionNot) Encode ¶
func (exp ExpressionNot) Encode() Expression
Encode converts the instance to a raw Expression
type ExpressionOr ¶
type ExpressionOr struct { Type ExpressionType `json:"type" yaml:"type" mapstructure:"type"` Expressions []Expression `json:"expressions" yaml:"expressions" mapstructure:"expressions"` }
ExpressionOr is an object which represents the disjunction of expressions
func NewExpressionOr ¶ added in v0.3.1
func NewExpressionOr(expressions ...ExpressionEncoder) *ExpressionOr
NewExpressionOr creates an ExpressionOr instance
func (ExpressionOr) Encode ¶
func (exp ExpressionOr) Encode() Expression
Encode converts the instance to a raw Expression
type ExpressionType ¶
type ExpressionType string
ExpressionType represents the filtering expression enums
const ( ExpressionTypeAnd ExpressionType = "and" ExpressionTypeOr ExpressionType = "or" ExpressionTypeNot ExpressionType = "not" ExpressionTypeUnaryComparisonOperator ExpressionType = "unary_comparison_operator" ExpressionTypeBinaryComparisonOperator ExpressionType = "binary_comparison_operator" ExpressionTypeExists ExpressionType = "exists" )
func ParseExpressionType ¶
func ParseExpressionType(input string) (ExpressionType, error)
ParseExpressionType parses a comparison target type argument type from string
func (ExpressionType) IsValid ¶ added in v0.3.1
func (j ExpressionType) IsValid() bool
IsValid checks if the value is invalid
func (*ExpressionType) UnmarshalJSON ¶
func (j *ExpressionType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ExpressionUnaryComparisonOperator ¶
type ExpressionUnaryComparisonOperator struct { Type ExpressionType `json:"type" yaml:"type" mapstructure:"type"` Operator UnaryComparisonOperator `json:"operator" yaml:"operator" mapstructure:"operator"` Column ComparisonTarget `json:"column" yaml:"column" mapstructure:"column"` }
ExpressionUnaryComparisonOperator is an object which represents a unary operator expression
func NewExpressionUnaryComparisonOperator ¶ added in v0.3.1
func NewExpressionUnaryComparisonOperator(column ComparisonTarget, operator UnaryComparisonOperator) *ExpressionUnaryComparisonOperator
NewExpressionUnaryComparisonOperator creates an ExpressionUnaryComparisonOperator instance
func (ExpressionUnaryComparisonOperator) Encode ¶
func (exp ExpressionUnaryComparisonOperator) Encode() Expression
Encode converts the instance to a raw Expression
type Field ¶
Field represents a field
func (Field) AsColumn ¶
func (j Field) AsColumn() (*ColumnField, error)
AsColumn tries to convert the current type to ColumnField
func (Field) AsRelationship ¶
func (j Field) AsRelationship() (*RelationshipField, error)
AsRelationship tries to convert the current type to RelationshipField
func (Field) Interface ¶
func (j Field) Interface() FieldEncoder
Interface converts the comparison value to its generic interface
func (Field) InterfaceT ¶
func (j Field) InterfaceT() (FieldEncoder, error)
InterfaceT converts the comparison value to its generic interface safely with explicit error
func (*Field) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type FieldEncoder ¶
type FieldEncoder interface {
Encode() Field
}
type FieldType ¶
type FieldType string
FieldType represents a field type
func ParseFieldType ¶
ParseFieldType parses a field type from string
func (*FieldType) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type ForeignKeyConstraint ¶
type ForeignKeyConstraint struct { // The columns on which you want want to define the foreign key. ColumnMapping ForeignKeyConstraintColumnMapping `json:"column_mapping" yaml:"column_mapping" mapstructure:"column_mapping"` // The name of a collection ForeignCollection string `json:"foreign_collection" yaml:"foreign_collection" mapstructure:"foreign_collection"` }
func (*ForeignKeyConstraint) UnmarshalJSON ¶
func (j *ForeignKeyConstraint) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ForeignKeyConstraintColumnMapping ¶
The columns on which you want want to define the foreign key.
type FunctionInfo ¶
type FunctionInfo struct { // Any arguments that this collection requires Arguments FunctionInfoArguments `json:"arguments" yaml:"arguments" mapstructure:"arguments"` // Description of the function Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"` // The name of the function Name string `json:"name" yaml:"name" mapstructure:"name"` // The name of the function's result type ResultType Type `json:"result_type" yaml:"result_type" mapstructure:"result_type"` }
func (*FunctionInfo) UnmarshalJSON ¶
func (j *FunctionInfo) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
func (*FunctionInfo) UnmarshalJSONMap ¶ added in v0.2.0
func (j *FunctionInfo) UnmarshalJSONMap(raw map[string]json.RawMessage) error
UnmarshalJSONMap decodes FunctionInfo from a JSON map.
type FunctionInfoArguments ¶
type FunctionInfoArguments map[string]ArgumentInfo
Any arguments that this collection requires
type LeafCapability ¶
type LeafCapability map[string]interface{}
A unit value to indicate a particular leaf capability is supported. This is an empty struct to allow for future sub-capabilities.
type MutationCapabilities ¶
type MutationCapabilities struct { // Does the connector support explaining mutations Explain interface{} `json:"explain,omitempty" yaml:"explain,omitempty" mapstructure:"explain,omitempty"` // Does the connector support executing multiple mutations in a transaction. Transactional interface{} `json:"transactional,omitempty" yaml:"transactional,omitempty" mapstructure:"transactional,omitempty"` }
type MutationOperation ¶
type MutationOperation struct { Type MutationOperationType `json:"type" yaml:"type" mapstructure:"type"` // The name of the operation Name string `json:"name" yaml:"name" mapstructure:"name"` // Any named procedure arguments Arguments json.RawMessage `json:"arguments" yaml:"arguments" mapstructure:"arguments"` // The fields to return from the result, or null to return everything Fields NestedField `json:"fields,omitempty" yaml:"fields,omitempty" mapstructure:"fields"` }
MutationOperation represents a mutation operation
func (*MutationOperation) UnmarshalJSON ¶
func (j *MutationOperation) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type MutationOperationResults ¶
MutationOperationResults represent the result of mutation operation
func (MutationOperationResults) AsProcedure ¶
func (j MutationOperationResults) AsProcedure() (*ProcedureResult, error)
AsProcedure tries to convert the instance to ProcedureResult type
func (MutationOperationResults) Interface ¶
func (j MutationOperationResults) Interface() MutationOperationResultsEncoder
Interface tries to convert the instance to MutationOperationResultsEncoder interface
func (MutationOperationResults) InterfaceT ¶
func (j MutationOperationResults) InterfaceT() (MutationOperationResultsEncoder, error)
InterfaceT tries to convert the instance to MutationOperationResultsEncoder interface safely with explicit error
func (MutationOperationResults) Type ¶
func (j MutationOperationResults) Type() (MutationOperationType, error)
Type gets the type enum of the current type
func (*MutationOperationResults) UnmarshalJSON ¶
func (j *MutationOperationResults) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type MutationOperationResultsEncoder ¶
type MutationOperationResultsEncoder interface {
Encode() MutationOperationResults
}
MutationOperationResultsEncoder abstracts the serialization interface for MutationOperationResults
type MutationOperationType ¶
type MutationOperationType string
MutationOperationType represents the mutation operation type enum
const (
MutationOperationProcedure MutationOperationType = "procedure"
)
func ParseMutationOperationType ¶
func ParseMutationOperationType(input string) (*MutationOperationType, error)
ParseMutationOperationType parses a mutation operation type argument type from string
func (*MutationOperationType) UnmarshalJSON ¶
func (j *MutationOperationType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type MutationRequest ¶
type MutationRequest struct { // The relationships between collections involved in the entire mutation request CollectionRelationships MutationRequestCollectionRelationships `json:"collection_relationships" yaml:"collection_relationships" mapstructure:"collection_relationships"` // The mutation operations to perform Operations []MutationOperation `json:"operations" yaml:"operations" mapstructure:"operations"` }
func (*MutationRequest) UnmarshalJSON ¶
func (j *MutationRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type MutationRequestCollectionRelationships ¶
type MutationRequestCollectionRelationships map[string]Relationship
The relationships between collections involved in the entire mutation request
type MutationResponse ¶
type MutationResponse struct { // The results of each mutation operation, in the same order as they were received OperationResults []MutationOperationResults `json:"operation_results" yaml:"operation_results" mapstructure:"operation_results"` }
func (*MutationResponse) UnmarshalJSON ¶
func (j *MutationResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type NamedType ¶
type NamedType struct { Type TypeEnum `json:"type" yaml:"type" mapstructure:"type"` // The name can refer to a primitive type or a scalar type Name string `json:"name" yaml:"name" mapstructure:"name"` }
NamedType represents a named type
func GetUnderlyingNamedType ¶ added in v0.3.1
GetUnderlyingNamedType gets the underlying named type of the input type recursively if exists
func NewNamedType ¶
NewNamedType creates a new NamedType instance
type NestedArray ¶
type NestedArray struct { Type NestedFieldType `json:"type" yaml:"type" mapstructure:"type"` Fields NestedField `json:"fields" yaml:"fields" mapstructure:"fields"` }
NestedArray presents a nested array field
func NewNestedArray ¶
func NewNestedArray(fields NestedFieldEncoder) *NestedArray
NewNestedArray create a new NestedArray instance
func (NestedArray) Encode ¶
func (ob NestedArray) Encode() NestedField
Encode converts the instance to raw NestedField
type NestedField ¶
NestedField represents a nested field
func (NestedField) AsArray ¶
func (j NestedField) AsArray() (*NestedArray, error)
AsArray tries to convert the instance to NestedArray type
func (NestedField) AsObject ¶
func (j NestedField) AsObject() (*NestedObject, error)
AsObject tries to convert the instance to NestedObject type
func (NestedField) Interface ¶
func (j NestedField) Interface() NestedFieldEncoder
Interface tries to convert the instance to NestedFieldEncoder interface
func (NestedField) InterfaceT ¶
func (j NestedField) InterfaceT() (NestedFieldEncoder, error)
Interface tries to convert the instance to NestedFieldEncoder interface safely with explicit error
func (NestedField) IsNil ¶ added in v0.1.3
func (j NestedField) IsNil() bool
IsNil checks if the field is null or empty
func (NestedField) Type ¶
func (j NestedField) Type() (NestedFieldType, error)
Type gets the type enum of the current type
func (*NestedField) UnmarshalJSON ¶
func (j *NestedField) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type NestedFieldCapabilities ¶ added in v0.3.1
type NestedFieldCapabilities struct { // Does the connector support aggregating values within nested fields Aggregates interface{} `json:"aggregates,omitempty" yaml:"aggregates,omitempty" mapstructure:"aggregates,omitempty"` // Does the connector support filtering by values of nested fields FilterBy interface{} `json:"filter_by,omitempty" yaml:"filter_by,omitempty" mapstructure:"filter_by,omitempty"` // Does the connector support ordering by values of nested fields OrderBy interface{} `json:"order_by,omitempty" yaml:"order_by,omitempty" mapstructure:"order_by,omitempty"` }
type NestedFieldEncoder ¶
type NestedFieldEncoder interface {
Encode() NestedField
}
NestedFieldEncoder abstracts the serialization interface for NestedField
type NestedFieldType ¶
type NestedFieldType string
NestedFieldType represents a nested field type enum
const ( NestedFieldTypeObject NestedFieldType = "object" NestedFieldTypeArray NestedFieldType = "array" )
func ParseNestedFieldType ¶
func ParseNestedFieldType(input string) (NestedFieldType, error)
ParseNestedFieldType parses the type of nested field
func (NestedFieldType) IsValid ¶ added in v0.3.1
func (j NestedFieldType) IsValid() bool
IsValid checks if the value is invalid
func (*NestedFieldType) UnmarshalJSON ¶
func (j *NestedFieldType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type NestedObject ¶
type NestedObject struct { Type NestedFieldType `json:"type" yaml:"type" mapstructure:"type"` Fields map[string]Field `json:"fields" yaml:"fields" mapstructure:"fields"` }
NestedObject presents a nested object field
func NewNestedObject ¶
func NewNestedObject(fields map[string]FieldEncoder) *NestedObject
NewNestedObject create a new NestedObject instance
func (NestedObject) Encode ¶
func (ob NestedObject) Encode() NestedField
Encode converts the instance to raw NestedField
type NullableType ¶
type NullableType struct { Type TypeEnum `json:"type" yaml:"type" mapstructure:"type"` // The type of the non-null inhabitants of this type UnderlyingType Type `json:"underlying_type" yaml:"underlying_type" mapstructure:"underlying_type"` }
NullableType represents a nullable type
func NewNullableNamedType ¶
func NewNullableNamedType(name string) *NullableType
NewNullableNamedType creates a new NullableType instance with underlying named type
func NewNullableType ¶
func NewNullableType(underlyingType TypeEncoder) *NullableType
NewNullableType creates a new NullableType instance with underlying type
func (NullableType) Encode ¶
func (ty NullableType) Encode() Type
Encode returns the raw Type instance
func (NullableType) String ¶ added in v0.3.1
func (ty NullableType) String() string
String implements the fmt.Stringer interface
type ObjectField ¶
type ObjectField struct { // The arguments available to the field - Matches implementation from // CollectionInfo Arguments ObjectFieldArguments `json:"arguments,omitempty" yaml:"arguments,omitempty" mapstructure:"arguments,omitempty"` // Description of this field Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"` // The type of this field Type Type `json:"type" yaml:"type" mapstructure:"type"` }
The definition of an object field
func (*ObjectField) UnmarshalJSON ¶
func (j *ObjectField) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ObjectFieldArguments ¶ added in v0.3.1
type ObjectFieldArguments map[string]ArgumentInfo
The arguments available to the field - Matches implementation from CollectionInfo
type ObjectType ¶
type ObjectType struct { // Description of this type Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"` // Fields defined on this object type Fields ObjectTypeFields `json:"fields" yaml:"fields" mapstructure:"fields"` }
The definition of an object type
func (*ObjectType) UnmarshalJSON ¶
func (j *ObjectType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ObjectTypeFields ¶
type ObjectTypeFields map[string]ObjectField
Fields defined on this object type
type OrderBy ¶
type OrderBy struct { // The elements to order by, in priority order Elements []OrderByElement `json:"elements" yaml:"elements" mapstructure:"elements"` }
func (*OrderBy) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type OrderByColumn ¶
type OrderByColumn struct { Type OrderByTargetType `json:"type" yaml:"type" mapstructure:"type"` // The name of the column Name string `json:"name" yaml:"name" mapstructure:"name"` // Any relationships to traverse to reach this column Path []PathElement `json:"path" yaml:"path" mapstructure:"path"` // Any field path to a nested field within the column FieldPath []string `json:"field_path,omitempty" yaml:"field_path,omitempty" mapstructure:"field_path"` }
OrderByColumn represents an ordering object which compares the value in the selected column
func NewOrderByColumn ¶ added in v0.3.1
func NewOrderByColumn(name string, path []PathElement, fieldPath []string) *OrderByColumn
NewOrderByColumn creates an OrderByColumn instance
func NewOrderByColumnName ¶ added in v0.3.1
func NewOrderByColumnName(name string) *OrderByColumn
NewOrderByColumnName creates an OrderByColumn instance with column name only
func (OrderByColumn) Encode ¶
func (ob OrderByColumn) Encode() OrderByTarget
Encode converts the instance to raw OrderByTarget
type OrderByElement ¶
type OrderByElement struct { // OrderDirection corresponds to the JSON schema field "order_direction". OrderDirection OrderDirection `json:"order_direction" yaml:"order_direction" mapstructure:"order_direction"` // Target corresponds to the JSON schema field "target". Target OrderByTarget `json:"target" yaml:"target" mapstructure:"target"` }
func (*OrderByElement) UnmarshalJSON ¶
func (j *OrderByElement) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type OrderBySingleColumnAggregate ¶
type OrderBySingleColumnAggregate struct { Type OrderByTargetType `json:"type" yaml:"name" mapstructure:"type"` // The column to apply the aggregation function to Column string `json:"column" yaml:"column" mapstructure:"column"` // Single column aggregate function name. Function string `json:"function" yaml:"function" mapstructure:"function"` // Non-empty collection of relationships to traverse Path []PathElement `json:"path" yaml:"path" mapstructure:"path"` // Path to a nested field within an object column. FieldPath []string `json:"field_path,omitempty" yaml:"field_path,omitempty" mapstructure:"field_path"` }
OrderBySingleColumnAggregate An ordering of type single_column_aggregate orders rows by an aggregate computed over rows in some related collection. If the respective aggregates are incomparable, the ordering should continue to the next OrderByElement.
func NewOrderBySingleColumnAggregate ¶ added in v0.3.1
func NewOrderBySingleColumnAggregate(column string, function string, path []PathElement, fieldPath []string) *OrderBySingleColumnAggregate
NewOrderBySingleColumnAggregate creates an OrderBySingleColumnAggregate instance
func (OrderBySingleColumnAggregate) Encode ¶
func (ob OrderBySingleColumnAggregate) Encode() OrderByTarget
Encode converts the instance to raw OrderByTarget
type OrderByStarCountAggregate ¶
type OrderByStarCountAggregate struct { Type OrderByTargetType `json:"type" yaml:"type" mapstructure:"type"` // Non-empty collection of relationships to traverse Path []PathElement `json:"path" yaml:"path" mapstructure:"path"` }
OrderByStarCountAggregate An ordering of type star_count_aggregate orders rows by a count of rows in some related collection. If the respective aggregates are incomparable, the ordering should continue to the next OrderByElement.
func NewOrderByStarCountAggregate ¶ added in v0.3.1
func NewOrderByStarCountAggregate(path []PathElement) *OrderByStarCountAggregate
NewOrderByStarCountAggregate creates an OrderByStarCountAggregate instance
func (OrderByStarCountAggregate) Encode ¶
func (ob OrderByStarCountAggregate) Encode() OrderByTarget
Encode converts the instance to raw OrderByTarget
type OrderByTarget ¶
OrderByTarget represents an order_by field of the Query object
func (OrderByTarget) AsColumn ¶
func (j OrderByTarget) AsColumn() (*OrderByColumn, error)
AsColumn tries to convert the instance to OrderByColumn type
func (OrderByTarget) AsSingleColumnAggregate ¶
func (j OrderByTarget) AsSingleColumnAggregate() (*OrderBySingleColumnAggregate, error)
AsSingleColumnAggregate tries to convert the instance to OrderBySingleColumnAggregate type
func (OrderByTarget) AsStarCountAggregate ¶
func (j OrderByTarget) AsStarCountAggregate() (*OrderByStarCountAggregate, error)
AsStarCountAggregate tries to convert the instance to OrderByStarCountAggregate type
func (OrderByTarget) Interface ¶
func (j OrderByTarget) Interface() OrderByTargetEncoder
Interface tries to convert the instance to OrderByTargetEncoder interface
func (OrderByTarget) InterfaceT ¶
func (j OrderByTarget) InterfaceT() (OrderByTargetEncoder, error)
InterfaceT tries to convert the instance to OrderByTargetEncoder interface safely with explicit error
func (OrderByTarget) Type ¶
func (j OrderByTarget) Type() (OrderByTargetType, error)
Type gets the type enum of the current type
func (*OrderByTarget) UnmarshalJSON ¶
func (j *OrderByTarget) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type OrderByTargetEncoder ¶
type OrderByTargetEncoder interface {
Encode() OrderByTarget
}
OrderByTargetEncoder abstracts the serialization interface for OrderByTarget
type OrderByTargetType ¶
type OrderByTargetType string
OrderByTargetType represents a ordering target type
const ( OrderByTargetTypeColumn OrderByTargetType = "column" OrderByTargetTypeSingleColumnAggregate OrderByTargetType = "single_column_aggregate" OrderByTargetTypeStarCountAggregate OrderByTargetType = "star_count_aggregate" )
func ParseOrderByTargetType ¶
func ParseOrderByTargetType(input string) (OrderByTargetType, error)
ParseOrderByTargetType parses a ordering target type argument type from string
func (OrderByTargetType) IsValid ¶ added in v0.3.1
func (j OrderByTargetType) IsValid() bool
IsValid checks if the value is invalid
func (*OrderByTargetType) UnmarshalJSON ¶
func (j *OrderByTargetType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type OrderDirection ¶
type OrderDirection string
const OrderDirectionAsc OrderDirection = "asc"
const OrderDirectionDesc OrderDirection = "desc"
func (*OrderDirection) UnmarshalJSON ¶
func (j *OrderDirection) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PathElement ¶
type PathElement struct { // Values to be provided to any collection arguments Arguments PathElementArguments `json:"arguments" yaml:"arguments" mapstructure:"arguments"` // A predicate expression to apply to the target collection Predicate Expression `json:"predicate,omitempty" yaml:"predicate,omitempty" mapstructure:"predicate,omitempty"` // The name of the relationship to follow Relationship string `json:"relationship" yaml:"relationship" mapstructure:"relationship"` }
func (*PathElement) UnmarshalJSON ¶
func (j *PathElement) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PathElementArguments ¶
type PathElementArguments map[string]RelationshipArgument
Values to be provided to any collection arguments
type PredicateType ¶
type PredicateType struct { Type TypeEnum `json:"type" yaml:"type" mapstructure:"type"` // The name can refer to a primitive type or a scalar type ObjectTypeName string `json:"object_type_name" yaml:"object_type_name" mapstructure:"object_type_name"` }
PredicateType represents a predicate type for a given object type
func NewPredicateType ¶
func NewPredicateType(objectTypeName string) *PredicateType
NewPredicateType creates a new PredicateType instance
func (PredicateType) Encode ¶
func (ty PredicateType) Encode() Type
Encode returns the raw Type instance
func (PredicateType) String ¶ added in v0.3.1
func (ty PredicateType) String() string
String implements the fmt.Stringer interface
type ProcedureInfo ¶
type ProcedureInfo struct { // Any arguments that this collection requires Arguments ProcedureInfoArguments `json:"arguments" yaml:"arguments" mapstructure:"arguments"` // Column description Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"` // The name of the procedure Name string `json:"name" yaml:"name" mapstructure:"name"` // The name of the result type ResultType Type `json:"result_type" yaml:"result_type" mapstructure:"result_type"` }
func (*ProcedureInfo) UnmarshalJSON ¶
func (j *ProcedureInfo) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
func (*ProcedureInfo) UnmarshalJSONMap ¶ added in v0.2.0
func (j *ProcedureInfo) UnmarshalJSONMap(raw map[string]json.RawMessage) error
UnmarshalJSONMap decodes ProcedureInfo from a JSON map.
type ProcedureInfoArguments ¶
type ProcedureInfoArguments map[string]ArgumentInfo
Any arguments that this collection requires
type ProcedureResult ¶
type ProcedureResult struct { Type MutationOperationType `json:"type" yaml:"type" mapstructure:"type"` Result any `json:"result" yaml:"result" mapstructure:"result"` }
ProcedureResult represent the result of a procedure mutation operation
func NewProcedureResult ¶
func NewProcedureResult(result any) *ProcedureResult
NewProcedureResult creates a MutationProcedureResult instance
func (ProcedureResult) Encode ¶
func (pr ProcedureResult) Encode() MutationOperationResults
Encode encodes the struct to MutationOperationResults
type Query ¶
type Query struct { // Aggregate fields of the query Aggregates QueryAggregates `json:"aggregates,omitempty" yaml:"aggregates,omitempty" mapstructure:"aggregates,omitempty"` // Fields of the query Fields QueryFields `json:"fields,omitempty" yaml:"fields,omitempty" mapstructure:"fields,omitempty"` // Optionally limit to N results Limit *int `json:"limit,omitempty" yaml:"limit,omitempty" mapstructure:"limit,omitempty"` // Optionally offset from the Nth result Offset *int `json:"offset,omitempty" yaml:"offset,omitempty" mapstructure:"offset,omitempty"` // OrderBy corresponds to the JSON schema field "order_by". OrderBy *OrderBy `json:"order_by,omitempty" yaml:"order_by,omitempty" mapstructure:"order_by,omitempty"` // Predicate corresponds to the JSON schema field "predicate". Predicate Expression `json:"predicate,omitempty" yaml:"predicate,omitempty" mapstructure:"predicate,omitempty"` }
type QueryCapabilities ¶
type QueryCapabilities struct { // Does the connector support aggregate queries Aggregates interface{} `json:"aggregates,omitempty" yaml:"aggregates,omitempty" mapstructure:"aggregates,omitempty"` // Does the connector support EXISTS predicates Exists ExistsCapabilities `json:"exists,omitempty" yaml:"exists,omitempty" mapstructure:"exists,omitempty"` // Does the connector support explaining queries Explain interface{} `json:"explain,omitempty" yaml:"explain,omitempty" mapstructure:"explain,omitempty"` // Does the connector support nested fields NestedFields NestedFieldCapabilities `json:"nested_fields,omitempty" yaml:"nested_fields,omitempty" mapstructure:"nested_fields,omitempty"` // Does the connector support queries which use variables Variables interface{} `json:"variables,omitempty" yaml:"variables,omitempty" mapstructure:"variables,omitempty"` }
func (*QueryCapabilities) UnmarshalJSON ¶ added in v0.3.1
func (j *QueryCapabilities) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type QueryRequest ¶
type QueryRequest struct { // Values to be provided to any collection arguments Arguments QueryRequestArguments `json:"arguments" yaml:"arguments" mapstructure:"arguments"` // The name of a collection Collection string `json:"collection" yaml:"collection" mapstructure:"collection"` // Any relationships between collections involved in the query request CollectionRelationships QueryRequestCollectionRelationships `json:"collection_relationships" yaml:"collection_relationships" mapstructure:"collection_relationships"` // The query syntax tree Query Query `json:"query" yaml:"query" mapstructure:"query"` // One set of named variables for each rowset to fetch. Each variable set should // be subtituted in turn, and a fresh set of rows returned. Variables []QueryRequestVariablesElem `json:"variables,omitempty" yaml:"variables,omitempty" mapstructure:"variables,omitempty"` }
This is the request body of the query POST endpoint
func (*QueryRequest) UnmarshalJSON ¶
func (j *QueryRequest) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type QueryRequestArguments ¶
Values to be provided to any collection arguments
type QueryRequestCollectionRelationships ¶
type QueryRequestCollectionRelationships map[string]Relationship
Any relationships between collections involved in the query request
type QueryRequestVariablesElem ¶
type QueryRequestVariablesElem map[string]interface{}
type QueryResponse ¶
type QueryResponse []RowSet
Query responses may return multiple RowSets when using queries with variables. Else, there should always be exactly one RowSet
type RawCapabilitiesResponse ¶ added in v0.2.0
type RawCapabilitiesResponse struct {
// contains filtered or unexported fields
}
RawCapabilitiesResponse represents a NDC capabilities response with pre-encoded raw bytes
func NewRawCapabilitiesResponse ¶ added in v0.2.0
func NewRawCapabilitiesResponse(data []byte) (*RawCapabilitiesResponse, error)
NewRawCapabilitiesResponse creates and validate a RawSchemaResponse instance
func NewRawCapabilitiesResponseUnsafe ¶ added in v0.3.0
func NewRawCapabilitiesResponseUnsafe(data []byte) *RawCapabilitiesResponse
NewRawCapabilitiesResponseUnsafe creates a RawSchemaResponse instance from raw bytes without validation
func (RawCapabilitiesResponse) MarshalCapabilitiesJSON ¶ added in v0.2.0
func (j RawCapabilitiesResponse) MarshalCapabilitiesJSON() ([]byte, error)
MarshalCapabilitiesJSON encodes the NDC schema response to JSON
type RawSchemaResponse ¶ added in v0.2.0
type RawSchemaResponse struct {
// contains filtered or unexported fields
}
RawSchemaResponse represents a NDC schema response with pre-encoded raw bytes
func NewRawSchemaResponse ¶ added in v0.2.0
func NewRawSchemaResponse(data []byte) (*RawSchemaResponse, error)
NewRawSchemaResponse creates and validate a RawSchemaResponse instance
func NewRawSchemaResponseUnsafe ¶ added in v0.3.0
func NewRawSchemaResponseUnsafe(data []byte) *RawSchemaResponse
NewRawSchemaResponse creates a RawSchemaResponse instance from raw bytes without validation
func (RawSchemaResponse) MarshalSchemaJSON ¶ added in v0.2.0
func (j RawSchemaResponse) MarshalSchemaJSON() ([]byte, error)
MarshalSchemaJSON encodes the NDC schema response to JSON
type Relationship ¶
type Relationship struct { // Values to be provided to any collection arguments Arguments RelationshipArguments `json:"arguments" yaml:"arguments" mapstructure:"arguments"` // A mapping between columns on the source collection to columns on the target // collection ColumnMapping RelationshipColumnMapping `json:"column_mapping" yaml:"column_mapping" mapstructure:"column_mapping"` // RelationshipType corresponds to the JSON schema field "relationship_type". RelationshipType RelationshipType `json:"relationship_type" yaml:"relationship_type" mapstructure:"relationship_type"` // The name of a collection TargetCollection string `json:"target_collection" yaml:"target_collection" mapstructure:"target_collection"` }
func (*Relationship) UnmarshalJSON ¶
func (j *Relationship) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type RelationshipArgument ¶
type RelationshipArgument struct { Type RelationshipArgumentType `json:"type" yaml:"type" mapstructure:"type"` Name string `json:"name" yaml:"name" mapstructure:"name"` Value any `json:"value" yaml:"value" mapstructure:"value"` }
RelationshipArgument is provided by reference to a variable or as a literal value
TODO: may change RelationshipArgument to a generic map in the future
func (RelationshipArgument) AsColumn ¶ added in v0.3.1
func (j RelationshipArgument) AsColumn() (*RelationshipArgumentColumn, error)
AsColumn converts the instance to RelationshipArgumentColumn
func (RelationshipArgument) AsLiteral ¶ added in v0.3.1
func (j RelationshipArgument) AsLiteral() (*RelationshipArgumentLiteral, error)
AsLiteral converts the instance to RelationshipArgumentLiteral
func (RelationshipArgument) AsVariable ¶ added in v0.3.1
func (j RelationshipArgument) AsVariable() (*RelationshipArgumentVariable, error)
AsVariable converts the instance to RelationshipArgumentVariable
func (RelationshipArgument) Interface ¶ added in v0.3.1
func (j RelationshipArgument) Interface() RelationshipArgumentEncoder
Interface converts the comparison value to its generic interface
func (RelationshipArgument) InterfaceT ¶ added in v0.3.1
func (j RelationshipArgument) InterfaceT() (RelationshipArgumentEncoder, error)
InterfaceT converts the comparison value to its generic interface safely with explicit error
func (*RelationshipArgument) UnmarshalJSON ¶
func (j *RelationshipArgument) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type RelationshipArgumentColumn ¶ added in v0.3.1
type RelationshipArgumentColumn struct { Type RelationshipArgumentType `json:"type" yaml:"type" mapstructure:"type"` Name string `json:"name" yaml:"name" mapstructure:"name"` }
RelationshipArgumentColumn represents the column relationship argument
func NewRelationshipArgumentColumn ¶ added in v0.3.1
func NewRelationshipArgumentColumn(name string) *RelationshipArgumentColumn
NewRelationshipArgumentColumn creates a RelationshipArgumentColumn instance
func (RelationshipArgumentColumn) Encode ¶ added in v0.3.1
func (j RelationshipArgumentColumn) Encode() RelationshipArgument
Encode converts the instance to raw Field
type RelationshipArgumentEncoder ¶ added in v0.3.1
type RelationshipArgumentEncoder interface {
Encode() RelationshipArgument
}
RelationshipArgumentEncoder abstracts the interface for RelationshipArgument
type RelationshipArgumentLiteral ¶ added in v0.3.1
type RelationshipArgumentLiteral struct { Type RelationshipArgumentType `json:"type" yaml:"type" mapstructure:"type"` Value any `json:"value" yaml:"value" mapstructure:"value"` }
RelationshipArgumentLiteral represents the literal relationship argument
func NewRelationshipArgumentLiteral ¶ added in v0.3.1
func NewRelationshipArgumentLiteral(value any) *RelationshipArgumentLiteral
NewRelationshipArgumentLiteral creates a RelationshipArgumentLiteral instance
func (RelationshipArgumentLiteral) Encode ¶ added in v0.3.1
func (j RelationshipArgumentLiteral) Encode() RelationshipArgument
Encode converts the instance to raw Field
type RelationshipArgumentType ¶
type RelationshipArgumentType string
RelationshipArgumentType represents a relationship argument type enum
const ( RelationshipArgumentTypeLiteral RelationshipArgumentType = "literal" RelationshipArgumentTypeVariable RelationshipArgumentType = "variable" RelationshipArgumentTypeColumn RelationshipArgumentType = "column" )
func ParseRelationshipArgumentType ¶
func ParseRelationshipArgumentType(input string) (RelationshipArgumentType, error)
ParseRelationshipArgumentType parses a relationship argument type from string
func (RelationshipArgumentType) IsValid ¶ added in v0.3.1
func (j RelationshipArgumentType) IsValid() bool
IsValid checks if the value is invalid
func (*RelationshipArgumentType) UnmarshalJSON ¶
func (j *RelationshipArgumentType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type RelationshipArgumentVariable ¶ added in v0.3.1
type RelationshipArgumentVariable struct { Type RelationshipArgumentType `json:"type" yaml:"type" mapstructure:"type"` Name string `json:"name" yaml:"name" mapstructure:"name"` }
RelationshipArgumentVariable represents the variable relationship argument
func NewRelationshipArgumentVariable ¶ added in v0.3.1
func NewRelationshipArgumentVariable(name string) *RelationshipArgumentVariable
NewRelationshipArgumentVariable creates a RelationshipArgumentVariable instance
func (RelationshipArgumentVariable) Encode ¶ added in v0.3.1
func (j RelationshipArgumentVariable) Encode() RelationshipArgument
Encode converts the instance to raw Field
type RelationshipArguments ¶
type RelationshipArguments map[string]RelationshipArgument
Values to be provided to any collection arguments
type RelationshipCapabilities ¶
type RelationshipCapabilities struct { // Does the connector support ordering by an aggregated array relationship? OrderByAggregate interface{} `json:"order_by_aggregate,omitempty" yaml:"order_by_aggregate,omitempty" mapstructure:"order_by_aggregate,omitempty"` // Does the connector support comparisons that involve related collections (ie. // joins)? RelationComparisons interface{} `json:"relation_comparisons,omitempty" yaml:"relation_comparisons,omitempty" mapstructure:"relation_comparisons,omitempty"` }
type RelationshipColumnMapping ¶
A mapping between columns on the source collection to columns on the target collection
type RelationshipField ¶
type RelationshipField struct { Type FieldType `json:"type" yaml:"type" mapstructure:"type"` // The relationship query Query Query `json:"query" yaml:"query" mapstructure:"query"` // The name of the relationship to follow for the subquery Relationship string `json:"relationship" yaml:"relationship" mapstructure:"relationship"` // Values to be provided to any collection arguments Arguments map[string]RelationshipArgument `json:"arguments" yaml:"arguments" mapstructure:"arguments"` }
RelationshipField represents a relationship field
func NewRelationshipField ¶
func NewRelationshipField(query Query, relationship string, arguments map[string]RelationshipArgument) *RelationshipField
NewRelationshipField creates a new RelationshipField instance
func (RelationshipField) Encode ¶
func (f RelationshipField) Encode() Field
Encode converts the instance to raw Field
type RelationshipType ¶
type RelationshipType string
const RelationshipTypeArray RelationshipType = "array"
const RelationshipTypeObject RelationshipType = "object"
func (*RelationshipType) UnmarshalJSON ¶
func (j *RelationshipType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type RowFieldValue ¶
type RowFieldValue interface{}
type RowSet ¶
type RowSet struct { // The results of the aggregates returned by the query Aggregates RowSetAggregates `json:"aggregates,omitempty" yaml:"aggregates,omitempty" mapstructure:"aggregates,omitempty"` // The rows returned by the query, corresponding to the query's fields Rows []map[string]any `json:"rows,omitempty" yaml:"rows,omitempty" mapstructure:"rows,omitempty"` }
type RowSetAggregates ¶
type RowSetAggregates map[string]interface{}
The results of the aggregates returned by the query
type ScalarType ¶
type ScalarType struct { // A map from aggregate function names to their definitions. Result type names // must be defined scalar types declared in ScalarTypesCapabilities. AggregateFunctions ScalarTypeAggregateFunctions `json:"aggregate_functions" yaml:"aggregate_functions" mapstructure:"aggregate_functions"` // A map from comparison operator names to their definitions. Argument type names // must be defined scalar types declared in ScalarTypesCapabilities. ComparisonOperators map[string]ComparisonOperatorDefinition `json:"comparison_operators" yaml:"comparison_operators" mapstructure:"comparison_operators"` // A description of valid values for this scalar type. Defaults to // `TypeRepresentation::JSON` if omitted Representation TypeRepresentation `json:"representation,omitempty" yaml:"representation,omitempty" mapstructure:"representation,omitempty"` }
The definition of a scalar type, i.e. types that can be used as the types of columns.
func NewScalarType ¶
func NewScalarType() *ScalarType
NewScalarType creates an empty ScalarType instance
func (*ScalarType) UnmarshalJSON ¶
func (j *ScalarType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ScalarTypeAggregateFunctions ¶
type ScalarTypeAggregateFunctions map[string]AggregateFunctionDefinition
A map from aggregate function names to their definitions. Result type names must be defined scalar types declared in ScalarTypesCapabilities.
type SchemaGeneratedJson ¶
type SchemaGeneratedJson struct { // CapabilitiesResponse corresponds to the JSON schema field // "capabilities_response". CapabilitiesResponse CapabilitiesResponse `json:"capabilities_response" yaml:"capabilities_response" mapstructure:"capabilities_response"` // ErrorResponse corresponds to the JSON schema field "error_response". ErrorResponse ErrorResponse `json:"error_response" yaml:"error_response" mapstructure:"error_response"` // ExplainResponse corresponds to the JSON schema field "explain_response". ExplainResponse ExplainResponse `json:"explain_response" yaml:"explain_response" mapstructure:"explain_response"` // MutationRequest corresponds to the JSON schema field "mutation_request". MutationRequest MutationRequest `json:"mutation_request" yaml:"mutation_request" mapstructure:"mutation_request"` // MutationResponse corresponds to the JSON schema field "mutation_response". MutationResponse MutationResponse `json:"mutation_response" yaml:"mutation_response" mapstructure:"mutation_response"` // QueryRequest corresponds to the JSON schema field "query_request". QueryRequest QueryRequest `json:"query_request" yaml:"query_request" mapstructure:"query_request"` // QueryResponse corresponds to the JSON schema field "query_response". QueryResponse QueryResponse `json:"query_response" yaml:"query_response" mapstructure:"query_response"` // SchemaResponse corresponds to the JSON schema field "schema_response". SchemaResponse SchemaResponse `json:"schema_response" yaml:"schema_response" mapstructure:"schema_response"` // ValidateResponse corresponds to the JSON schema field "validate_response". ValidateResponse ValidateResponse `json:"validate_response" yaml:"validate_response" mapstructure:"validate_response"` }
func (*SchemaGeneratedJson) UnmarshalJSON ¶
func (j *SchemaGeneratedJson) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SchemaResponse ¶
type SchemaResponse struct { // Collections which are available for queries Collections []CollectionInfo `json:"collections" yaml:"collections" mapstructure:"collections"` // Functions (i.e. collections which return a single column and row) Functions []FunctionInfo `json:"functions" yaml:"functions" mapstructure:"functions"` // A list of object types which can be used as the types of arguments, or return // types of procedures. Names should not overlap with scalar type names. ObjectTypes SchemaResponseObjectTypes `json:"object_types" yaml:"object_types" mapstructure:"object_types"` // Procedures which are available for execution as part of mutations Procedures []ProcedureInfo `json:"procedures" yaml:"procedures" mapstructure:"procedures"` // A list of scalar types which will be used as the types of collection columns ScalarTypes SchemaResponseScalarTypes `json:"scalar_types" yaml:"scalar_types" mapstructure:"scalar_types"` }
func (SchemaResponse) MarshalSchemaJSON ¶ added in v0.2.0
func (j SchemaResponse) MarshalSchemaJSON() ([]byte, error)
MarshalSchemaJSON encodes the NDC schema response to JSON
func (*SchemaResponse) UnmarshalJSON ¶
func (j *SchemaResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SchemaResponseMarshaler ¶ added in v0.2.0
SchemaResponseMarshaler abstract the response for /schema handler
type SchemaResponseObjectTypes ¶
type SchemaResponseObjectTypes map[string]ObjectType
A list of object types which can be used as the types of arguments, or return types of procedures. Names should not overlap with scalar type names.
type SchemaResponseScalarTypes ¶
type SchemaResponseScalarTypes map[string]ScalarType
A list of scalar types which will be used as the types of collection columns
type Type ¶
Types track the valid representations of values as JSON
func UnwrapNullableType ¶ added in v0.3.1
UnwrapNullableType unwraps nullable types from the input type recursively
func (Type) AsNullable ¶
func (ty Type) AsNullable() (*NullableType, error)
AsNullable tries to convert the current type to NullableType
func (Type) AsPredicate ¶
func (ty Type) AsPredicate() (*PredicateType, error)
AsPredicate tries to convert the current type to PredicateType
func (Type) Interface ¶
func (ty Type) Interface() TypeEncoder
Interface converts the instance to the TypeEncoder interface
func (Type) InterfaceT ¶
func (ty Type) InterfaceT() (TypeEncoder, error)
InterfaceT converts the instance to the TypeEncoder interface safely with explicit error
func (*Type) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type TypeEncoder ¶
type TypeEncoder interface {
Encode() Type
}
TypeEncoder abstracts the Type interface
type TypeEnum ¶
type TypeEnum string
func ParseTypeEnum ¶
ParseTypeEnum parses a type enum from string
func (*TypeEnum) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type TypeRepresentation ¶ added in v0.3.1
Representations of scalar types
func (TypeRepresentation) AsBigDecimal ¶ added in v0.3.1
func (ty TypeRepresentation) AsBigDecimal() (*TypeRepresentationBigDecimal, error)
AsBigDecimal tries to convert the current type to TypeRepresentationBigDecimal
func (TypeRepresentation) AsBigInteger ¶ added in v0.3.1
func (ty TypeRepresentation) AsBigInteger() (*TypeRepresentationBigInteger, error)
AsBigInteger tries to convert the current type to TypeRepresentationBigInteger
func (TypeRepresentation) AsBoolean ¶ added in v0.3.1
func (ty TypeRepresentation) AsBoolean() (*TypeRepresentationBoolean, error)
AsBoolean tries to convert the current type to TypeRepresentationBoolean
func (TypeRepresentation) AsBytes ¶ added in v0.3.1
func (ty TypeRepresentation) AsBytes() (*TypeRepresentationBytes, error)
AsBytes tries to convert the current type to TypeRepresentationBytes
func (TypeRepresentation) AsDate ¶ added in v0.3.1
func (ty TypeRepresentation) AsDate() (*TypeRepresentationDate, error)
AsDate tries to convert the current type to TypeRepresentationDate
func (TypeRepresentation) AsEnum ¶ added in v0.3.1
func (ty TypeRepresentation) AsEnum() (*TypeRepresentationEnum, error)
AsEnum tries to convert the current type to TypeRepresentationEnum
func (TypeRepresentation) AsFloat32 ¶ added in v0.3.1
func (ty TypeRepresentation) AsFloat32() (*TypeRepresentationFloat32, error)
AsFloat32 tries to convert the current type to TypeRepresentationFloat32
func (TypeRepresentation) AsFloat64 ¶ added in v0.3.1
func (ty TypeRepresentation) AsFloat64() (*TypeRepresentationFloat64, error)
AsFloat64 tries to convert the current type to TypeRepresentationFloat64
func (TypeRepresentation) AsGeography ¶ added in v0.3.1
func (ty TypeRepresentation) AsGeography() (*TypeRepresentationGeography, error)
AsGeography tries to convert the current type to TypeRepresentationGeography
func (TypeRepresentation) AsGeometry ¶ added in v0.3.1
func (ty TypeRepresentation) AsGeometry() (*TypeRepresentationGeometry, error)
AsGeometry tries to convert the current type to TypeRepresentationGeometry
func (TypeRepresentation) AsInt16 ¶ added in v0.3.1
func (ty TypeRepresentation) AsInt16() (*TypeRepresentationInt16, error)
AsInt16 tries to convert the current type to TypeRepresentationInt16
func (TypeRepresentation) AsInt32 ¶ added in v0.3.1
func (ty TypeRepresentation) AsInt32() (*TypeRepresentationInt32, error)
AsInt32 tries to convert the current type to TypeRepresentationInt32
func (TypeRepresentation) AsInt64 ¶ added in v0.3.1
func (ty TypeRepresentation) AsInt64() (*TypeRepresentationInt64, error)
AsInt64 tries to convert the current type to TypeRepresentationInt64
func (TypeRepresentation) AsInt8 ¶ added in v0.3.1
func (ty TypeRepresentation) AsInt8() (*TypeRepresentationInt8, error)
AsInt8 tries to convert the current type to TypeRepresentationInt8
func (TypeRepresentation) AsInteger
deprecated
added in
v0.3.1
func (ty TypeRepresentation) AsInteger() (*TypeRepresentationInteger, error)
AsInteger tries to convert the current type to TypeRepresentationInteger
Deprecated: Deprecate Int and Number representations
func (TypeRepresentation) AsJSON ¶ added in v0.3.1
func (ty TypeRepresentation) AsJSON() (*TypeRepresentationJSON, error)
AsJSON tries to convert the current type to TypeRepresentationJSON
func (TypeRepresentation) AsNumber
deprecated
added in
v0.3.1
func (ty TypeRepresentation) AsNumber() (*TypeRepresentationNumber, error)
AsNumber tries to convert the current type to TypeRepresentationNumber
Deprecated: Deprecate Int and Number representations
func (TypeRepresentation) AsString ¶ added in v0.3.1
func (ty TypeRepresentation) AsString() (*TypeRepresentationString, error)
AsString tries to convert the current type to TypeRepresentationString
func (TypeRepresentation) AsTimestamp ¶ added in v0.3.1
func (ty TypeRepresentation) AsTimestamp() (*TypeRepresentationTimestamp, error)
AsTimestamp tries to convert the current type to TypeRepresentationTimestamp
func (TypeRepresentation) AsTimestampTZ ¶ added in v0.3.1
func (ty TypeRepresentation) AsTimestampTZ() (*TypeRepresentationTimestampTZ, error)
AsTimestampTZ tries to convert the current type to TypeRepresentationTimestampTZ
func (TypeRepresentation) AsUUID ¶ added in v0.3.1
func (ty TypeRepresentation) AsUUID() (*TypeRepresentationUUID, error)
AsUUID tries to convert the current type to TypeRepresentationUUID
func (TypeRepresentation) Interface ¶ added in v0.3.1
func (ty TypeRepresentation) Interface() TypeRepresentationEncoder
Interface converts the instance to the TypeRepresentationEncoder interface
func (TypeRepresentation) InterfaceT ¶ added in v0.3.1
func (ty TypeRepresentation) InterfaceT() (TypeRepresentationEncoder, error)
InterfaceT converts the instance to the TypeRepresentationEncoder interface safely with explicit error
func (TypeRepresentation) Type ¶ added in v0.3.1
func (ty TypeRepresentation) Type() (TypeRepresentationType, error)
Type gets the type enum of the current type
func (*TypeRepresentation) UnmarshalJSON ¶ added in v0.3.1
func (j *TypeRepresentation) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type TypeRepresentationBigDecimal ¶ added in v0.3.1
type TypeRepresentationBigDecimal struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationBigDecimal represents an arbitrary-precision decimal string
func NewTypeRepresentationBigDecimal ¶ added in v0.3.1
func NewTypeRepresentationBigDecimal() *TypeRepresentationBigDecimal
NewTypeRepresentationBigDecimal creates a new TypeRepresentationBigDecimal instance
func (TypeRepresentationBigDecimal) Encode ¶ added in v0.3.1
func (ty TypeRepresentationBigDecimal) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationBigInteger ¶ added in v0.3.1
type TypeRepresentationBigInteger struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationBigInteger represents an arbitrary-precision integer string
func NewTypeRepresentationBigInteger ¶ added in v0.3.1
func NewTypeRepresentationBigInteger() *TypeRepresentationBigInteger
NewTypeRepresentationBigInteger creates a new TypeRepresentationBigInteger instance
func (TypeRepresentationBigInteger) Encode ¶ added in v0.3.1
func (ty TypeRepresentationBigInteger) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationBoolean ¶ added in v0.3.1
type TypeRepresentationBoolean struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationBoolean represents a JSON boolean type representation
func NewTypeRepresentationBoolean ¶ added in v0.3.1
func NewTypeRepresentationBoolean() *TypeRepresentationBoolean
NewTypeRepresentationBoolean creates a new TypeRepresentationBoolean instance
func (TypeRepresentationBoolean) Encode ¶ added in v0.3.1
func (ty TypeRepresentationBoolean) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationBytes ¶ added in v0.3.1
type TypeRepresentationBytes struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationBytes represent a base64-encoded bytes
func NewTypeRepresentationBytes ¶ added in v0.3.1
func NewTypeRepresentationBytes() *TypeRepresentationBytes
NewTypeRepresentationBytes creates a new TypeRepresentationBytes instance
func (TypeRepresentationBytes) Encode ¶ added in v0.3.1
func (ty TypeRepresentationBytes) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationDate ¶ added in v0.3.1
type TypeRepresentationDate struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationDate represents an ISO 8601 date
func NewTypeRepresentationDate ¶ added in v0.3.1
func NewTypeRepresentationDate() *TypeRepresentationDate
NewTypeRepresentationDate creates a new TypeRepresentationDate instance
func (TypeRepresentationDate) Encode ¶ added in v0.3.1
func (ty TypeRepresentationDate) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationEncoder ¶ added in v0.3.1
type TypeRepresentationEncoder interface {
Encode() TypeRepresentation
}
TypeRepresentationEncoder abstracts the TypeRepresentation interface
type TypeRepresentationEnum ¶ added in v0.3.1
type TypeRepresentationEnum struct { Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"` OneOf []string `json:"one_of" yaml:"one_of" mapstructure:"one_of"` }
TypeRepresentationEnum represents an enum type representation
func NewTypeRepresentationEnum ¶ added in v0.3.1
func NewTypeRepresentationEnum(oneOf []string) *TypeRepresentationEnum
NewTypeRepresentationEnum creates a new TypeRepresentationEnum instance
func (TypeRepresentationEnum) Encode ¶ added in v0.3.1
func (ty TypeRepresentationEnum) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationFloat32 ¶ added in v0.3.1
type TypeRepresentationFloat32 struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationFloat32 represents an IEEE-754 single-precision floating-point number
func NewTypeRepresentationFloat32 ¶ added in v0.3.1
func NewTypeRepresentationFloat32() *TypeRepresentationFloat32
NewTypeRepresentationFloat32 creates a new TypeRepresentationFloat32 instance
func (TypeRepresentationFloat32) Encode ¶ added in v0.3.1
func (ty TypeRepresentationFloat32) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationFloat64 ¶ added in v0.3.1
type TypeRepresentationFloat64 struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationFloat64 represents an IEEE-754 double-precision floating-point number
func NewTypeRepresentationFloat64 ¶ added in v0.3.1
func NewTypeRepresentationFloat64() *TypeRepresentationFloat64
NewTypeRepresentationFloat64 creates a new TypeRepresentationFloat64 instance
func (TypeRepresentationFloat64) Encode ¶ added in v0.3.1
func (ty TypeRepresentationFloat64) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationGeography ¶ added in v0.3.1
type TypeRepresentationGeography struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationGeography represents a geography JSON object
func NewTypeRepresentationGeography ¶ added in v0.3.1
func NewTypeRepresentationGeography() *TypeRepresentationGeography
NewTypeRepresentationGeography creates a new TypeRepresentationGeography instance
func (TypeRepresentationGeography) Encode ¶ added in v0.3.1
func (ty TypeRepresentationGeography) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationGeometry ¶ added in v0.3.1
type TypeRepresentationGeometry struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationGeometry represents a geography JSON object
func NewTypeRepresentationGeometry ¶ added in v0.3.1
func NewTypeRepresentationGeometry() *TypeRepresentationGeometry
NewTypeRepresentationGeometry creates a new TypeRepresentationGeometry instance
func (TypeRepresentationGeometry) Encode ¶ added in v0.3.1
func (ty TypeRepresentationGeometry) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationInt16 ¶ added in v0.3.1
type TypeRepresentationInt16 struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationInt16 represents a 16-bit signed integer with a minimum value of -2^15 and a maximum value of 2^15 - 1
func NewTypeRepresentationInt16 ¶ added in v0.3.1
func NewTypeRepresentationInt16() *TypeRepresentationInt16
NewTypeRepresentationInt16 creates a new TypeRepresentationInt16 instance
func (TypeRepresentationInt16) Encode ¶ added in v0.3.1
func (ty TypeRepresentationInt16) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationInt32 ¶ added in v0.3.1
type TypeRepresentationInt32 struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationInt32 represents a 32-bit signed integer with a minimum value of -2^31 and a maximum value of 2^31 - 1
func NewTypeRepresentationInt32 ¶ added in v0.3.1
func NewTypeRepresentationInt32() *TypeRepresentationInt32
NewTypeRepresentationInt32 creates a new TypeRepresentationInt32 instance
func (TypeRepresentationInt32) Encode ¶ added in v0.3.1
func (ty TypeRepresentationInt32) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationInt64 ¶ added in v0.3.1
type TypeRepresentationInt64 struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationInt64 represents a 64-bit signed integer with a minimum value of -2^63 and a maximum value of 2^63 - 1
func NewTypeRepresentationInt64 ¶ added in v0.3.1
func NewTypeRepresentationInt64() *TypeRepresentationInt64
NewTypeRepresentationInt64 creates a new TypeRepresentationInt64 instance
func (TypeRepresentationInt64) Encode ¶ added in v0.3.1
func (ty TypeRepresentationInt64) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationInt8 ¶ added in v0.3.1
type TypeRepresentationInt8 struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationInt8 represents a 8-bit signed integer with a minimum value of -2^7 and a maximum value of 2^7 - 1
func NewTypeRepresentationInt8 ¶ added in v0.3.1
func NewTypeRepresentationInt8() *TypeRepresentationInt8
NewTypeRepresentationInt8 creates a new TypeRepresentationInt8 instance
func (TypeRepresentationInt8) Encode ¶ added in v0.3.1
func (ty TypeRepresentationInt8) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationInteger
deprecated
added in
v0.3.1
type TypeRepresentationInteger struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationInteger represents a JSON integer type representation
Deprecated: Deprecate Int and Number representations
func NewTypeRepresentationInteger ¶ added in v0.3.1
func NewTypeRepresentationInteger() *TypeRepresentationInteger
NewTypeRepresentationInteger creates a new TypeRepresentationInteger instance
func (TypeRepresentationInteger) Encode ¶ added in v0.3.1
func (ty TypeRepresentationInteger) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationJSON ¶ added in v0.3.1
type TypeRepresentationJSON struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationJSON represents an arbitrary JSON
func NewTypeRepresentationJSON ¶ added in v0.3.1
func NewTypeRepresentationJSON() *TypeRepresentationJSON
NewTypeRepresentationJSON creates a new TypeRepresentationBytes instance
func (TypeRepresentationJSON) Encode ¶ added in v0.3.1
func (ty TypeRepresentationJSON) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationNumber
deprecated
added in
v0.3.1
type TypeRepresentationNumber struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationNumber represents a JSON number type representation
Deprecated: Deprecate Int and Number representations
func NewTypeRepresentationNumber ¶ added in v0.3.1
func NewTypeRepresentationNumber() *TypeRepresentationNumber
NewTypeRepresentationNumber creates a new TypeRepresentationNumber instance
func (TypeRepresentationNumber) Encode ¶ added in v0.3.1
func (ty TypeRepresentationNumber) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationString ¶ added in v0.3.1
type TypeRepresentationString struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationString represents a JSON string type representation
func NewTypeRepresentationString ¶ added in v0.3.1
func NewTypeRepresentationString() *TypeRepresentationString
NewTypeRepresentationString creates a new TypeRepresentationString instance
func (TypeRepresentationString) Encode ¶ added in v0.3.1
func (ty TypeRepresentationString) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationTimestamp ¶ added in v0.3.1
type TypeRepresentationTimestamp struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationTimestamp represents an ISO 8601 timestamp
func NewTypeRepresentationTimestamp ¶ added in v0.3.1
func NewTypeRepresentationTimestamp() *TypeRepresentationTimestamp
NewTypeRepresentationTimestamp creates a new TypeRepresentationTimestamp instance
func (TypeRepresentationTimestamp) Encode ¶ added in v0.3.1
func (ty TypeRepresentationTimestamp) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationTimestampTZ ¶ added in v0.3.1
type TypeRepresentationTimestampTZ struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationTimestampTZ represents an ISO 8601 timestamp-with-timezone
func NewTypeRepresentationTimestampTZ ¶ added in v0.3.1
func NewTypeRepresentationTimestampTZ() *TypeRepresentationTimestampTZ
NewTypeRepresentationTimestampTZ creates a new TypeRepresentationTimestampTZ instance
func (TypeRepresentationTimestampTZ) Encode ¶ added in v0.3.1
func (ty TypeRepresentationTimestampTZ) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type TypeRepresentationType ¶ added in v0.3.1
type TypeRepresentationType string
TypeRepresentationType represents the type enum of TypeRepresentation
const ( // JSON booleans TypeRepresentationTypeBoolean TypeRepresentationType = "boolean" // JSON booleans TypeRepresentationTypeString TypeRepresentationType = "string" // Any JSON number // // Deprecated: [Deprecate Int and Number representations] // // [Deprecate Int and Number representations]: https://github.com/hasura/ndc-spec/blob/main/rfcs/0007-additional-type-representations.md#deprecate-int-and-number-representations TypeRepresentationTypeNumber TypeRepresentationType = "number" // Any JSON number, with no decimal part // // Deprecated: [Deprecate Int and Number representations] // // [Deprecate Int and Number representations]: https://github.com/hasura/ndc-spec/blob/main/rfcs/0007-additional-type-representations.md#deprecate-int-and-number-representations TypeRepresentationTypeInteger TypeRepresentationType = "integer" // One of the specified string values TypeRepresentationTypeEnum TypeRepresentationType = "enum" // A 8-bit signed integer with a minimum value of -2^7 and a maximum value of 2^7 - 1 TypeRepresentationTypeInt8 TypeRepresentationType = "int8" // A 16-bit signed integer with a minimum value of -2^15 and a maximum value of 2^15 - 1 TypeRepresentationTypeInt16 TypeRepresentationType = "int16" // A 32-bit signed integer with a minimum value of -2^31 and a maximum value of 2^31 - 1 TypeRepresentationTypeInt32 TypeRepresentationType = "int32" // A 64-bit signed integer with a minimum value of -2^63 and a maximum value of 2^63 - 1 TypeRepresentationTypeInt64 TypeRepresentationType = "int64" // An IEEE-754 single-precision floating-point number TypeRepresentationTypeFloat32 TypeRepresentationType = "float32" // An IEEE-754 double-precision floating-point number TypeRepresentationTypeFloat64 TypeRepresentationType = "float64" // Arbitrary-precision integer string TypeRepresentationTypeBigInteger TypeRepresentationType = "biginteger" // Arbitrary-precision decimal string TypeRepresentationTypeBigDecimal TypeRepresentationType = "bigdecimal" // UUID string (8-4-4-4-12) TypeRepresentationTypeUUID TypeRepresentationType = "uuid" // ISO 8601 date TypeRepresentationTypeDate TypeRepresentationType = "date" // ISO 8601 timestamp TypeRepresentationTypeTimestamp TypeRepresentationType = "timestamp" // ISO 8601 timestamp-with-timezone TypeRepresentationTypeTimestampTZ TypeRepresentationType = "timestamptz" // GeoJSON, per RFC 7946 TypeRepresentationTypeGeography TypeRepresentationType = "geography" // GeoJSON Geometry object, per RFC 7946 TypeRepresentationTypeGeometry TypeRepresentationType = "geometry" // Base64-encoded bytes TypeRepresentationTypeBytes TypeRepresentationType = "bytes" // Arbitrary JSON TypeRepresentationTypeJSON TypeRepresentationType = "json" )
func ParseTypeRepresentationType ¶ added in v0.3.1
func ParseTypeRepresentationType(input string) (TypeRepresentationType, error)
ParseTypeRepresentationType parses a TypeRepresentationType enum from string
func (TypeRepresentationType) IsValid ¶ added in v0.3.1
func (j TypeRepresentationType) IsValid() bool
IsValid checks if the value is invalid
func (*TypeRepresentationType) UnmarshalJSON ¶ added in v0.3.1
func (j *TypeRepresentationType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type TypeRepresentationUUID ¶ added in v0.3.1
type TypeRepresentationUUID struct {
Type TypeRepresentationType `json:"type" yaml:"type" mapstructure:"type"`
}
TypeRepresentationUUID represents an UUID string (8-4-4-4-12)
func NewTypeRepresentationUUID ¶ added in v0.3.1
func NewTypeRepresentationUUID() *TypeRepresentationUUID
NewTypeRepresentationUUID creates a new TypeRepresentationUUID instance
func (TypeRepresentationUUID) Encode ¶ added in v0.3.1
func (ty TypeRepresentationUUID) Encode() TypeRepresentation
Encode returns the raw TypeRepresentation instance
type UnaryComparisonOperator ¶
type UnaryComparisonOperator string
const UnaryComparisonOperatorIsNull UnaryComparisonOperator = "is_null"
func (*UnaryComparisonOperator) UnmarshalJSON ¶
func (j *UnaryComparisonOperator) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type UniquenessConstraint ¶
type UniquenessConstraint struct { // A list of columns which this constraint requires to be unique UniqueColumns []string `json:"unique_columns" yaml:"unique_columns" mapstructure:"unique_columns"` }
func (*UniquenessConstraint) UnmarshalJSON ¶
func (j *UniquenessConstraint) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ValidateResponse ¶
type ValidateResponse struct { // Capabilities corresponds to the JSON schema field "capabilities". Capabilities CapabilitiesResponse `json:"capabilities" yaml:"capabilities" mapstructure:"capabilities"` // ResolvedConfiguration corresponds to the JSON schema field // "resolved_configuration". ResolvedConfiguration string `json:"resolved_configuration" yaml:"resolved_configuration" mapstructure:"resolved_configuration"` // Schema corresponds to the JSON schema field "schema". Schema SchemaResponse `json:"schema" yaml:"schema" mapstructure:"schema"` }
func (*ValidateResponse) UnmarshalJSON ¶
func (j *ValidateResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.