connutils

package
v0.0.0-...-8832f83 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RefTypeAction used for actions in DB and requests
	RefTypeAction RefType = "Action"
	// RefTypeKey used for keys in DB and requests
	RefTypeKey RefType = "Key"
	// RefTypeThing used for things in DB and requests
	RefTypeThing RefType = "Thing"
	// RefTypeNetworkAction used for actions in DB and requests
	RefTypeNetworkAction RefType = "NetworkAction"
	// RefTypeNetworkThing used for things in DB and requests
	RefTypeNetworkThing RefType = "NetworkThing"

	// Equal represents an operator for an operation to be equal
	Equal Operator = 1 << iota
	// NotEqual represents an operator for an operation to be unequal
	NotEqual
	// GreaterThan represents an operator for an operation to be greather than the value
	GreaterThan
	// GreaterThanEqual represents an operator for an operation to be greather or equal than the value
	GreaterThanEqual
	// LessThan represents an operator for an operation to be less than the value
	LessThan
	// LessThanEqual represents an operator for an operation to be less or equal than the value
	LessThanEqual

	// StaticNoRootKey message when no root key is found
	StaticNoRootKey string = "No root-key found."
	// StaticThingNotFound message when thing is not found
	StaticThingNotFound string = "Thing is not found in database"
	// StaticNoHistoryFound message for when no history is found
	StaticNoHistoryFound string = "No history is not found in database"
	// StaticActionNotFound message when action is not found
	StaticActionNotFound string = "Action is not found in database"
	// StaticKeyNotFound message when key is not found
	StaticKeyNotFound string = "Key is not found in database"

	// StaticMissingHeader message
	StaticMissingHeader string = "Please provide both X-API-KEY and X-API-TOKEN headers."
	// StaticInvalidToken message
	StaticInvalidToken string = "Provided token is invalid."
	// StaticKeyExpired message
	StaticKeyExpired string = "Provided key has expired."
)

Variables

This section is empty.

Functions

func DoExternalRequest

func DoExternalRequest(instance config.Instance, endpoint string, uuid strfmt.UUID) (response *http.Response, err error)

DoExternalRequest does a request to an external Weaviate Instance based on given parameters

func GenerateUUID

func GenerateUUID() strfmt.UUID

GenerateUUID returns a new UUID

func MakeUnixMillisecond

func MakeUnixMillisecond(t time.Time) int64

MakeUnixMillisecond returns the millisecond unix-version of the given time

func Must

func Must(i interface{}, err error) interface{}

Must panics if error, otherwise returns value

func NowUnix

func NowUnix() int64

NowUnix returns the current Unix time

func ResolveExternalCrossRef

func ResolveExternalCrossRef(instance config.Instance, endpoint string, uuid strfmt.UUID, responseObject interface{}) (err error)

ResolveExternalCrossRef resolves an object on an external instance using the given parameters and the Weaviate REST-API of the external instance

func Trace

func Trace()

Trace is used to display the running function in a connector

Types

type Operator

type Operator uint16

Operator is a representation of the operator for queries

type RefType

type RefType string

RefType is used to have a common name for the kind of items in Weaviate

type ValueType

type ValueType struct {
	Value    interface{} // String-value / int-value / etc.
	Operator Operator    // See Operator constants
	Contains bool        // Has 'contains' mark
}

ValueType is the type representing the value in the query

type WhereQuery

type WhereQuery struct {
	Property string
	Value    ValueType
}

WhereQuery represents the query itself

func WhereStringToStruct

func WhereStringToStruct(prop string, where string) (WhereQuery, error)

WhereStringToStruct is the 'compiler' for converting the filter/where query-string into a struct

Jump to

Keyboard shortcuts

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