utils

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// All is used when all the records needs to be worked on
	All string = "all"

	// One is used when oly a single record needs to be worked on
	One string = "one"

	// Count is used to count the number of documents returned
	Count string = "count"

	// Distinct is used to get the distinct values
	Distinct string = "distinct"

	// Upsert is used to upsert documents
	Upsert string = "upsert"

	// Delete is used to delete documents
	Delete string = "delete"

	// Update is used to update documents
	Update string = "update"

	// Create is used to create documents
	Create string = "create"
)
View Source
const (
	// Mongo is the constant for selecting MongoDB
	Mongo string = "mongo"

	// MySQL is the constant for selected MySQL
	MySQL string = "sql-mysql"

	// Postgres is the constant for selected Postgres
	Postgres string = "sql-postgres"
)
View Source
const (
	// TypeRealtimeSubscribe is the request type for live query subscription
	TypeRealtimeSubscribe string = "realtime-subscribe"

	// TypeRealtimeUnsubscribe is the request type for live query subscription
	TypeRealtimeUnsubscribe string = "realtime-unsubscribe"

	// TypeRealtimeFeed is the response type for realtime feed
	TypeRealtimeFeed string = "realtime-feed"

	// TypeServiceRegister is the request type for service registration
	TypeServiceRegister string = "service-register"

	// TypeServiceUnregister is the request type for service removal
	TypeServiceUnregister string = "service-unregister"

	// TypeServiceRequest is type triggering a service's function
	TypeServiceRequest string = "service-request"
)
View Source
const (
	// RealtimeInsert is for create operations
	RealtimeInsert string = "insert"

	// RealtimeUpdate is for update operations
	RealtimeUpdate string = "update"

	// RealtimeDelete is for delete operations
	RealtimeDelete string = "delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type M

type M map[string]interface{}

M is a type representing a map

func And

func And(conds ...M) M

And is a function to "and" multiple conditions together

func Cond

func Cond(f1, eval string, f2 interface{}) M

Cond is a function to write a condition

func GenerateFind

func GenerateFind(condition M) M

GenerateFind generates a mongo db find clause from the provided condition

func Or

func Or(conds ...M) M

Or is a function to "or" multiple conditions together

Jump to

Keyboard shortcuts

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