types

package
v1.0.0-alpha4 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

types package contains the public API types that are shared between both REST and GraphQL

Index

Constants

This section is empty.

Variables

View Source
var CqlOperators = map[string]string{
	"eq":    "=",
	"notEq": "!=",
	"gt":    ">",
	"gte":   ">=",
	"lt":    "<",
	"lte":   "<=",
	"in":    "IN",
}

CqlOperators contains the CQL operator for a given "graphql" operator

View Source
var StringToBigInt = unmarshallerToText(func() encoding.TextUnmarshaler {
	return &big.Int{}
})
View Source
var StringToDecimal = unmarshallerToText(func() encoding.TextUnmarshaler {
	return &inf.Dec{}
})
View Source
var StringToTime fromJsonFn = unmarshallerToText(func() encoding.TextUnmarshaler {
	return &time.Time{}
})

Functions

func Base64StringToByteArray

func Base64StringToByteArray(value interface{}) (interface{}, error)

func ByteArrayToBase64String

func ByteArrayToBase64String(value interface{}) interface{}

func CqlFormattedStringToDuration

func CqlFormattedStringToDuration(value interface{}) (interface{}, error)

func DurationToCqlFormattedString

func DurationToCqlFormattedString(value interface{}) interface{}

func Float64ToFloat32

func Float64ToFloat32(value interface{}) (interface{}, error)

func FloatToInt

func FloatToInt(value interface{}) (interface{}, error)

func FromJsonValue

func FromJsonValue(value interface{}, typeInfo gocql.TypeInfo) (interface{}, error)

func StringerToString

func StringerToString(value interface{}) interface{}

func TimeAsString

func TimeAsString(value interface{}) interface{}

func ToJsonValues

func ToJsonValues(rows []map[string]interface{}, table *gocql.TableMetadata) []map[string]interface{}

Types

type ConditionItem

type ConditionItem struct {
	Column   string      `json:"column"` // json representation using for error information only
	Operator string      `json:"operator"`
	Value    interface{} `json:"value"`
}

type ModificationResult

type ModificationResult struct {
	Applied bool                   `json:"applied"`
	Value   map[string]interface{} `json:"value"`
}

type MutationOptions

type MutationOptions struct {
	TTL               int `json:"ttl"`
	Consistency       int `json:"consistency"`
	SerialConsistency int `json:"serialConsistency"`
}

type QueryOptions

type QueryOptions struct {
	PageState         string `json:"pageState"`
	PageSize          int    `json:"pageSize"`
	Limit             int    `json:"limit"`
	Consistency       int    `json:"consistency"`
	SerialConsistency int    `json:"serialConsistency"`
}

type QueryResult

type QueryResult struct {
	PageState string                   `json:"pageState"`
	Values    []map[string]interface{} `json:"values"`
}

type Route

type Route struct {
	Method  string
	Pattern string
	Handler http.Handler
}

Route represents a request route to be served

Jump to

Keyboard shortcuts

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