model

package
v0.0.0-...-260b785 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeDate is variable used for Variable of type Date
	TypeDate string = "Date"
	// TypeTime is variable used for Variable of type Time
	TypeTime string = "Time"
	// TypeUUID is variable used for Variable of type UUID
	TypeUUID string = "UUID"
	// TypeInteger is variable used for Variable of type Integer
	TypeInteger string = "Integer"
	// TypeSmallInteger is variable used for Variable of type small int
	TypeSmallInteger string = "SmallInteger"
	// TypeBigInteger is variable used for Variable of type big int
	TypeBigInteger string = "BigInteger"
	// TypeChar is variable used for Variable of type characters with fixed size
	TypeChar string = "Char"
	// TypeVarChar is variable used for Variable of type characters with variable size
	TypeVarChar string = "Varchar"
	// TypeString is variable used for Variable of type String
	TypeString string = "String"
	// TypeFloat is a data type used for storing fractional values without specifying the precision,
	// the precision is set by the database
	TypeFloat string = "Float"
	// TypeDecimal is a data type used for storing fractional values in which the precision can be specified by the user
	TypeDecimal string = "Decimal"
	// TypeBoolean is variable used for Variable of type Boolean
	TypeBoolean string = "Boolean"
	// TypeDateTimeWithZone is variable used for Variable of type DateTime
	TypeDateTimeWithZone string = "DateTimeWithZone"
	// TypeDateTime is variable used for Variable of type DateTime
	TypeDateTime string = "DateTime"
	// TypeID is variable used for Variable of type ID
	TypeID string = "ID"
	// TypeJSON is variable used for Variable of type Jsonb
	TypeJSON string = "JSON"
	// DefaultCharacterSize is variable used for specifying size of sql type ID
	DefaultCharacterSize int = 100
	// TypeObject is a string with value object
	TypeObject string = "Object"
	// TypeEnum is a variable type enum
	TypeEnum string = "Enum"
	// DirectiveUnique is used in schema module to add unique index
	DirectiveUnique string = "unique"
	// DirectiveIndex is used in schema module to add index
	DirectiveIndex string = "index"
	// DirectiveForeign is used in schema module to add foreign key
	DirectiveForeign string = "foreign"
	// DirectivePrimary is used in schema module to add primary key
	DirectivePrimary string = "primary"
	// DirectiveAutoIncrement is used in schema module to add primary key
	DirectiveAutoIncrement string = "autoIncrement"
	// DirectiveCreatedAt is used in schema module to specify the created location
	DirectiveCreatedAt string = "createdAt"
	// DirectiveUpdatedAt  is used in schema module to add Updated location
	DirectiveUpdatedAt string = "updatedAt"
	// DirectiveLink is used in schema module to add link
	DirectiveLink string = "link"
	// DirectiveDefault is used to add default key
	DirectiveDefault string = "default"
	// DirectiveArgs is used in schema module to specify the created location
	DirectiveArgs string = "args"
	// DirectiveStringSize denotes the maximum allowable character for field type Char, Varchar, ID
	DirectiveStringSize string = "size"

	// DefaultIndexSort specifies default order of sorting
	DefaultIndexSort string = "asc"
	// DefaultIndexOrder specifies default order of order
	DefaultIndexOrder int = 1

	// DefaultScale specifies the default scale to be used for sql column types float,date,datetime if not provided
	DefaultScale int = 10
	// DefaultPrecision specifies the default precision to be used for sql column types float if not provided
	DefaultPrecision int = 38
	// DefaultDateTimePrecision specifies the default precision to be used for sql column types datetime & time
	DefaultDateTimePrecision int = 6
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminEventingInterface

type AdminEventingInterface interface {
	GetInternalAccessToken() (string, error)
}

AdminEventingInterface is an interface consisting of functions of admin module used by eventing module

type AggregateRequest

type AggregateRequest struct {
	Pipeline  interface{} `json:"pipe"`
	Operation string      `json:"op"`
}

AggregateRequest is the http body received for an aggregate request

type AllRequest

type AllRequest struct {
	Col       string                 `json:"col"`
	Document  interface{}            `json:"doc"`
	Operation string                 `json:"op"`
	Find      map[string]interface{} `json:"find"`
	Update    map[string]interface{} `json:"update"`
	Type      string                 `json:"type"`
	DBAlias   string                 `json:"dBAlias"`
	Extras    map[string]interface{} `json:"extras"`
}

AllRequest is a union of parameters required in the various requests

type AuthCrudInterface

type AuthCrudInterface interface {
	PostProcessMethod(ctx context.Context, postProcess *PostProcess, result interface{}) error
}

AuthCrudInterface is an interface consisting of functions of auth module used by crud module

type AuthEventingInterface

type AuthEventingInterface interface {
	CreateToken(ctx context.Context, tokenClaims TokenClaims) (string, error)
	GetInternalAccessToken(ctx context.Context) (string, error)
	GetSCAccessToken(ctx context.Context) (string, error)
	IsEventingOpAuthorised(ctx context.Context, project, token string, event *QueueEventRequest) (RequestParams, error)
	MatchRule(ctx context.Context, project string, rule *config.Rule, args, auth map[string]interface{}, returnWhere ReturnWhereStub) (*PostProcess, error)
}

AuthEventingInterface is an interface consisting of functions of auth module used by Eventing module

type AuthFilestoreInterface

type AuthFilestoreInterface interface {
	IsFileOpAuthorised(ctx context.Context, project, token, path string, op FileOpType, args map[string]interface{}) (*PostProcess, error)
}

AuthFilestoreInterface is an interface consisting of functions of auth module used by Filestore module

type AuthFunctionInterface

type AuthFunctionInterface interface {
	GetSCAccessToken(ctx context.Context) (string, error)
	Encrypt(value string) (string, error)
	CreateToken(ctx context.Context, tokenClaims TokenClaims) (string, error)
}

AuthFunctionInterface is an interface consisting of functions of auth module used by Function module

type AuthRealtimeInterface

type AuthRealtimeInterface interface {
	IsReadOpAuthorised(ctx context.Context, project, dbType, col, token string, req *ReadRequest, stub ReturnWhereStub) (*PostProcess, RequestParams, error)
	GetInternalAccessToken(ctx context.Context) (string, error)
	GetSCAccessToken(ctx context.Context) (string, error)
}

AuthRealtimeInterface is an interface consisting of functions of auth module used by RealTime module

type AuthSyncManInterface

type AuthSyncManInterface interface {
	GetIntegrationToken(ctx context.Context, id string) (string, error)
	GetMissionControlToken(ctx context.Context, claims map[string]interface{}) (string, error)
}

AuthSyncManInterface is an interface consisting of functions of auth module used by sync man

type AuthUserInterface

type AuthUserInterface interface {
	IsReadOpAuthorised(ctx context.Context, project, dbType, col, token string, req *ReadRequest, stub ReturnWhereStub) (*PostProcess, RequestParams, error)
	CreateToken(ctx context.Context, tokenClaims TokenClaims) (string, error)
	IsUpdateOpAuthorised(ctx context.Context, project, dbType, col, token string, req *UpdateRequest) (RequestParams, error)
}

AuthUserInterface is an interface consisting of functions of auth module used by User module

type BatchIntentHook

type BatchIntentHook func(ctx context.Context, dbAlias string, req *BatchRequest) (*EventIntent, error)

BatchIntentHook is used to log a create intent

type BatchRequest

type BatchRequest struct {
	Requests []*AllRequest `json:"reqs"`
}

BatchRequest is the http body for a batch request

type BatchSpecApplyRequest

type BatchSpecApplyRequest struct {
	Specs []*SpecObject `json:"specs" yaml:"specs"`
}

BatchSpecApplyRequest body of batch config apply endpoint

type CacheDatabaseResult

type CacheDatabaseResult struct {
	Result      interface{} `json:"result"`
	MetricCount int64       `json:"metricCount"`
}

CacheDatabaseResult is used to store cached database result

type CacheIngressRoute

type CacheIngressRoute struct {
	Body    []byte      `json:"body"`
	Headers http.Header `json:"headers"`
}

CacheIngressRoute corresponds to a value of ingress route key

type CachePurgeRequest

type CachePurgeRequest struct {
	Resource  config.Resource `json:"resource,omitempty"`
	DbAlias   string          `json:"dbAlias,omitempty"`
	ServiceID string          `json:"serviceId,omitempty"`
	ID        string          `json:"id,omitempty"`
}

CachePurgeRequest describes the payload for cache purge request

type CloudEventPayload

type CloudEventPayload struct {
	SpecVersion string      `json:"specversion" structs:"specversion" mapstructure:"specversion"`
	Type        string      `json:"type" structs:"type" mapstructure:"type"`
	Source      string      `json:"source" structs:"source" mapstructure:"source"`
	ID          string      `json:"id" structs:"id" mapstructure:"id"`
	Time        string      `json:"time" structs:"time" mapstructure:"time"`
	Data        interface{} `json:"data" structs:"data" mapstructure:"data"`
}

CloudEventPayload is the the JSON event spec by Cloud Events Specification

type Collection

type Collection map[string]Fields // key is collection name

Collection is a data structure for storing fields of schema

type Constraints

type Constraints struct {
	Replicas int32    `json:"replicas" yaml:"replicas"`
	CPU      *float32 `json:"cpu,omitempty" yaml:"cpu,omitempty"`
	Memory   *int64   `json:"memory,omitempty" yaml:"memory,omitempty"`
}

Constraints holds the constraints information

type CreateFileRequest

type CreateFileRequest struct {
	Meta    map[string]interface{} `json:"meta"`
	Path    string                 `json:"path"`
	Name    string                 `json:"name"`
	Type    string                 `json:"type"`    // Either file or dir
	MakeAll bool                   `json:"makeAll"` // This option is only available for creating directories
}

CreateFileRequest is the request received to create a new file or directory

type CreateIntentHook

type CreateIntentHook func(ctx context.Context, dbAlias, col string, req *CreateRequest) (*EventIntent, error)

CreateIntentHook is used to log a create intent

type CreateRequest

type CreateRequest struct {
	Document  interface{} `json:"doc"`
	Operation string      `json:"op"`
	IsBatch   bool        `json:"isBatch"`
}

CreateRequest is the http body received for a create request

type CrudAuthInterface

type CrudAuthInterface interface {
	Read(ctx context.Context, dbAlias, col string, req *ReadRequest, params RequestParams) (interface{}, *SQLMetaData, error)
}

CrudAuthInterface is an interface consisting of functions of crud module used by auth module

type CrudEventingInterface

type CrudEventingInterface interface {
	InternalCreate(ctx context.Context, dbAlias, project, col string, req *CreateRequest, isIgnoreMetrics bool) error
	InternalUpdate(ctx context.Context, dbAlias, project, col string, req *UpdateRequest) error
	Read(ctx context.Context, dbAlias, col string, req *ReadRequest, params RequestParams) (interface{}, *SQLMetaData, error)
	GetDBType(dbAlias string) (string, error)
	GetSchema(dbAlias, col string) (Fields, bool)
}

CrudEventingInterface is an interface consisting of functions of crud module used by Eventing module

type CrudRealtimeInterface

type CrudRealtimeInterface interface {
	Read(ctx context.Context, dbAlias, col string, req *ReadRequest, param RequestParams) (interface{}, *SQLMetaData, error)
}

CrudRealtimeInterface is an interface consisting of functions of crud module used by RealTime module

type CrudSchemaInterface

type CrudSchemaInterface interface {
	GetDBType(dbAlias string) (string, error)
	// CreateProjectIfNotExists(ctx context.Context, project, dbAlias string) error
	RawBatch(ctx context.Context, dbAlias string, batchedQueries []string) error
	DescribeTable(ctx context.Context, dbAlias, col string) ([]InspectorFieldType, []IndexType, error)
}

CrudSchemaInterface is an interface consisting of functions of crud module used by Schema module

type CrudUserInterface

type CrudUserInterface interface {
	GetDBType(dbAlias string) (string, error)
	Read(ctx context.Context, dbAlias, col string, req *ReadRequest, params RequestParams) (interface{}, *SQLMetaData, error)
	Create(ctx context.Context, dbAlias, col string, req *CreateRequest, params RequestParams) error
	Update(ctx context.Context, dbAlias, col string, req *UpdateRequest, params RequestParams) error
}

CrudUserInterface is an interface consisting of functions of crud module used by User module

type DBType

type DBType string

DBType is the type of database used for a particular crud operation

const (
	// Mongo is the type used for MongoDB
	Mongo DBType = "mongo"

	// EmbeddedDB is the type used for EmbeddedDB
	EmbeddedDB DBType = "embedded"

	// MySQL is the type used for MySQL
	MySQL DBType = "mysql"

	// Postgres is the type used for PostgresQL
	Postgres DBType = "postgres"

	// SQLServer is the type used for MsSQL
	SQLServer DBType = "sqlserver"

	// DefaultValidate is used for default validation operation
	DefaultValidate = "default"

	// DefaultFetchLimit is the default value to be used as a limit to fetch rows/collection in each read query
	DefaultFetchLimit = 1000
)

type DatabaseEventMessage

type DatabaseEventMessage struct {
	DBType string      `json:"db" mapstructure:"db"`
	Col    string      `json:"col" mapstructure:"col"`
	Doc    interface{} `json:"doc" mapstructure:"doc"`
	Find   interface{} `json:"find" mapstructure:"find"`
}

DatabaseEventMessage is the event payload for create, update and delete events

type DeleteFileRequest

type DeleteFileRequest struct {
	Meta map[string]interface{} `json:"meta"`
	Path string                 `json:"path"`
}

DeleteFileRequest is the request received to delete a new file or directory

type DeleteIntentHook

type DeleteIntentHook func(ctx context.Context, dbAlias, col string, req *DeleteRequest) (*EventIntent, error)

DeleteIntentHook is used to log a create intent

type DeleteRequest

type DeleteRequest struct {
	Find      map[string]interface{} `json:"find"`
	Operation string                 `json:"op"`
}

DeleteRequest is the http body received for a delete request

type Deploy

type Deploy struct {
	Name        string            `json:"name" yaml:"name"`
	Project     string            `json:"project" yaml:"project"`
	Runtime     *Runtime          `json:"runtime" yaml:"runtime"`
	Constraints *Constraints      `json:"constraints" yaml:"constraints"`
	Ports       []*Port           `json:"ports,omitempty" yaml:"ports,omitempty"`
	Env         map[string]string `json:"env" yaml:"env"`
	Expose      []*Expose         `json:"expose,omitempty" yaml:"expose,omitempty"`
}

Deploy holds the config for the deployment

type EventDocument

type EventDocument struct {
	ID             string      `structs:"_id" json:"_id" bson:"_id" mapstructure:"_id"`
	BatchID        string      `structs:"batchid" json:"batchid" bson:"batchid" mapstructure:"batchid"`
	Type           string      `structs:"type" json:"type" bson:"type" mapstructure:"type"`
	RuleName       string      `structs:"rule_name" json:"rule_name" bson:"rule_name" mapstructure:"rule_name"`
	Token          int         `structs:"token" json:"token" bson:"token" mapstructure:"token"`
	Timestamp      string      `structs:"ts" json:"ts" bson:"ts" mapstructure:"ts"`                         // The timestamp of when the event should get executed
	EventTimestamp string      `structs:"event_ts" json:"event_ts" bson:"event_ts" mapstructure:"event_ts"` // The time stamp of when the event was logged
	Payload        interface{} `structs:"payload" json:"payload" bson:"payload" mapstructure:"payload"`
	Status         string      `structs:"status" json:"status" bson:"status" mapstructure:"status"`
	Remark         string      `structs:"remark" json:"remark" bson:"remark" mapstructure:"remark"`
	TriggerType    string      `structs:"trigger_type,omitempty" json:"trigger_type,omitempty" bson:"trigger_type" mapstructure:"trigger_type"`
}

EventDocument is the format in which the event is persistent on disk

type EventIntent

type EventIntent struct {
	BatchID string
	Token   int
	Docs    []*EventDocument
	Invalid bool
}

EventIntent describes an intent made in the eventing system

type EventKind

type EventKind string

EventKind is the type describing the kind of event

type EventResponse

type EventResponse struct {
	Event    *QueueEventRequest   `json:"event,omitempty"`
	Events   []*QueueEventRequest `json:"events,omitempty"`
	Response interface{}          `json:"response,omitempty"` // for getting response of synchronous events
	Error    string               `json:"error,omitempty"`
}

EventResponse is struct response of events

type EventResponseMessage

type EventResponseMessage struct {
	BatchID  string      `json:"batchId" mapstructure:"batchId"`
	Response interface{} `json:"response" mapstructure:"response"`
}

EventResponseMessage describes the format for event response message

type EventingModule

type EventingModule interface {
	CreateFileIntentHook(ctx context.Context, req *CreateFileRequest) (*EventIntent, error)
	DeleteFileIntentHook(ctx context.Context, path string, meta map[string]interface{}) (*EventIntent, error)
	HookStage(ctx context.Context, intent *EventIntent, err error)
}

EventingModule is the interface to mock the eventing module

type EventingRealtimeInterface

type EventingRealtimeInterface interface {
	SetRealtimeTriggers(eventingRules []*config.EventingTrigger)
}

EventingRealtimeInterface is an interface consisting of functions of Eventing module used by RealTime module

type Expose

type Expose struct {
	Prefix *string `json:"prefix" yaml:"prefix"`
	Host   *string `json:"host" yaml:"host"`
	Proxy  *string `json:"proxy" yaml:"proxy"`
}

Expose holds the information about the ports to expose

type FeedData

type FeedData struct {
	QueryID   string      `json:"id,omitempty" structs:"id"`
	Type      string      `json:"type,omitempty" structs:"type"`
	Payload   interface{} `json:"payload,omitempty" structs:"payload"`
	TimeStamp int64       `json:"time,omitempty" structs:"time"`
	Group     string      `json:"group,omitempty" structs:"group"`
	DBType    string      `json:"dbType,omitempty" structs:"dbType"`
	TypeName  string      `json:"__typename,omitempty" structs:"__typename,omitempty"`
	Find      interface{} `json:"find,omitempty" structs:"find"`
}

FeedData is the format to send realtime data

type FieldArgs

type FieldArgs struct {
	// Precision is used to hold precision information for data types Float
	// It represent number the digits to be stored
	Precision int `json:"precision"`
	// Scale is used to hold scale information for data types Float,Time,DateTime
	// It represent number the digits to be stored after decimal
	Scale int `json:"scale"`
}

FieldArgs are properties of the column

type FieldType

type FieldType struct {
	FieldName           string     `json:"fieldName"`
	IsFieldTypeRequired bool       `json:"isFieldTypeRequired"`
	IsList              bool       `json:"isList"`
	Kind                string     `json:"kind"`
	Args                *FieldArgs `json:"args"`
	// Directive           string
	NestedObject Fields `json:"nestedObject"`
	IsPrimary    bool   `json:"isPrimary"`
	// For directives
	IsCreatedAt     bool `json:"isCreatedAt"`
	IsUpdatedAt     bool `json:"isUpdatedAt"`
	IsLinked        bool `json:"isLinked"`
	IsForeign       bool `json:"isForeign"`
	IsDefault       bool `json:"isDefault"`
	IsAutoIncrement bool
	PrimaryKeyInfo  *TableProperties   `json:"primaryKeyInfo"`
	IndexInfo       []*TableProperties `json:"indexInfo"`
	LinkedTable     *TableProperties   `json:"linkedTable"`
	JointTable      *TableProperties   `json:"jointTable"`
	Default         interface{}        `json:"default"`
	TypeIDSize      int                `json:"size"`
}

FieldType stores information about a particular column in table

type Fields

type Fields map[string]*FieldType // key is field name

Fields is a data structure for storing the type of field

type File

type File struct {
	File  io.Reader
	Close func() error
}

File is the struct returned for file reads

type FileOpType

type FileOpType string

FileOpType is the type of file operation being performed on the file store

const (
	// FileRead is the type used for read operations
	FileRead FileOpType = "read"

	// FileCreate is the type used for create operations
	FileCreate FileOpType = "create"

	// FileDelete is the type used for delete operations
	FileDelete FileOpType = "delete"
)

type FilePayload

type FilePayload struct {
	Meta map[string]interface{} `json:"meta"`
	Path string                 `json:"path"`
	Type string                 `json:"type,omitempty"`
}

FilePayload is body of request to file module

type FileReader

type FileReader func(io.Reader) (int, error)

FileReader is a function type used for file streaming

type FilestoreEventingInterface

type FilestoreEventingInterface interface {
	DoesExists(ctx context.Context, project, token, path string) error
}

FilestoreEventingInterface is an interface consisting of functions of Filestore module used by Eventing module

type FunctionsRequest

type FunctionsRequest struct {
	Params  interface{}              `json:"params"`
	Timeout int                      `json:"timeout"`
	Cache   *config.ReadCacheOptions `json:"cache"`
}

FunctionsRequest is the api call request

type GraphQLCallback

type GraphQLCallback func(op interface{}, err error)

GraphQLCallback is used as a callback for graphql requests

type GraphQLRequest

type GraphQLRequest struct {
	Query         string                 `json:"query"`
	OperationName string                 `json:"operationName"`
	Variables     map[string]interface{} `json:"variables"`
}

GraphQLRequest is the payload received in a graphql request

type GraphqlFetchLicenseResponse

type GraphqlFetchLicenseResponse struct {
	Result  *UpgradeResponse `json:"result"`
	Error   string           `json:"error"`
	Message string           `json:"message"`
	Status  int              `json:"status"`
}

GraphqlFetchLicenseResponse is the response fetch license request

type GraphqlFetchPublicKeyResponse

type GraphqlFetchPublicKeyResponse struct {
	Result  string `json:"result"`
	Error   string `json:"error"`
	Message string `json:"message"`
	Status  int    `json:"status"`
}

GraphqlFetchPublicKeyResponse is the response fetch public key request

type HTTPEventingInterface

type HTTPEventingInterface interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPEventingInterface is an interface consisting of functions of a http client used by eventing module

type IndexType

type IndexType struct {
	TableSchema string `db:"TABLE_SCHEMA"`
	TableName   string `db:"TABLE_NAME"`
	ColumnName  string `db:"COLUMN_NAME"`
	IndexName   string `db:"INDEX_NAME"`
	Order       int    `db:"SEQ_IN_INDEX"`
	// Sort can be either (asc) or (desc)
	Sort string `db:"SORT"`
	// IsUnique specifies whether the column has a unique index
	IsUnique bool `db:"IS_UNIQUE"`
	// IsPrimary specifies whether the column has a index
	IsPrimary bool `db:"IS_PRIMARY"`
}

IndexType is the type use to indexkey information of sql inspection

type InspectorFieldType

type InspectorFieldType struct {
	// TableSchema is the schema name for postgres & sqlserver.
	// it is the database name for mysql
	TableSchema string `db:"TABLE_SCHEMA"`
	TableName   string `db:"TABLE_NAME"`

	ColumnName string `db:"COLUMN_NAME"`
	// FieldType is the data type of column
	FieldType string `db:"DATA_TYPE"`
	// FieldNull specifies whether the given column can be null or not
	// It can be either (NO) or (YES)
	FieldNull       string `db:"IS_NULLABLE"`
	OrdinalPosition string `db:"ORDINAL_POSITION"`
	// FieldDefault specifies the default value of columns
	FieldDefault string `db:"DEFAULT"`
	// AutoIncrement specifies whether the column has auto increment constraint
	// It can be either (true) or (false)
	AutoIncrement     string `db:"AUTO_INCREMENT"`
	VarcharSize       int    `db:"CHARACTER_MAXIMUM_LENGTH"`
	NumericScale      int    `db:"NUMERIC_SCALE"`
	NumericPrecision  int    `db:"NUMERIC_PRECISION"`
	DateTimePrecision int    `db:"DATETIME_PRECISION"`

	ConstraintName string `db:"CONSTRAINT_NAME"`
	DeleteRule     string `db:"DELETE_RULE"`
	RefTableSchema string `db:"REFERENCED_TABLE_SCHEMA"`
	RefTableName   string `db:"REFERENCED_TABLE_NAME"`
	RefColumnName  string `db:"REFERENCED_COLUMN_NAME"`
}

InspectorFieldType is the type for storing sql inspection information

type InvocationDocument

type InvocationDocument struct {
	ID                 string `struct:"_id" json:"_id" bson:"_id" mapstructure:"_id"`
	EventID            string `struct:"event_id" json:"event_id" bson:"event_id" mapstructure:"event_id"`
	InvocationTime     string `struct:"invocation_time" json:"invocation_time" bson:"invocation_time" mapstructure:"invocation_time"`
	RequestPayload     string `struct:"request_payload" json:"request_payload" bson:"request_payload" mapstructure:"request_payload"`
	ResponseStatusCode int    `struct:"response_status_code" json:"response_status_code" bson:"response_status_code" mapstructure:"response_status_code"`
	ResponseBody       string `struct:"response_body" json:"response_body" bson:"response_body" mapstructure:"response_body"`
	ErrorMessage       string `struct:"error_msg" json:"error_msg" bson:"error_msg" mapstructure:"error_msg"`
	Remark             string `struct:"remark" json:"remark" bson:"remark" mapstructure:"remark"`
}

InvocationDocument is the format in which the invocation are persistent on disk

type JoinOption

type JoinOption struct {
	// Op can be either All or One
	// This field decides the way the result of join is returned
	// If op is all, the result is returned as an array
	// If op is one, the result is returned as an object
	Op    string                 `json:"Op" mapstructure:"Op"`
	Type  string                 `json:"type" mapstructure:"type"`
	Table string                 `json:"table" mapstructure:"table"`
	As    string                 `json:"as" mapstructure:"as"`
	On    map[string]interface{} `json:"on" mapstructure:"on"`
	Join  []*JoinOption          `json:"join" mapstructure:"join"`
}

JoinOption describes the way a join needs to be performed

type License

type License struct {
	LicenseKey     string            `json:"licenseKey" mapstructure:"licenseKey" structs:"licenseKey"`
	LicenseRenewal string            `json:"licenseRenewal" mapstructure:"licenseRenewal" structs:"licenseRenewal"`
	SessionID      string            `json:"sessionId" mapstructure:"sessionId" structs:"sessionId"`
	Plan           string            `json:"plan" mapstructure:"plan" structs:"plan"`
	Meta           *LicenseTokenMeta `json:"meta" mapstructure:"meta" structs:"meta"`
}

License stores license info

type LicenseKeyMeta

type LicenseKeyMeta struct {
	ClusterName string `json:"clusterName" mapstructure:"clusterName" structs:"clusterName"`
}

LicenseKeyMeta stores license key meta

type LicenseTokenMeta

type LicenseTokenMeta struct {
	ProductMeta    *UsageQuotas    `json:"productMeta" mapstructure:"productMeta" structs:"productMeta"`
	LicenseKeyMeta *LicenseKeyMeta `json:"licenseKeyMeta" mapstructure:"licenseKeyMeta" structs:"licenseKeyMeta"`
}

LicenseTokenMeta stores license token meta info

type LicenseUpgradeRequest

type LicenseUpgradeRequest struct {
	LicenseKey   string `json:"licenseKey" mapstructure:"licenseKey"`
	LicenseValue string `json:"licenseValue" mapstructure:"licenseValue"`
	ClusterName  string `json:"clusterName" mapstructure:"clusterName"`
}

LicenseUpgradeRequest is the body of license upgrade request

type ListFilesRequest

type ListFilesRequest struct {
	Path string `json:"path"`
	Type string `json:"type"` // Type could be dir, file or all
}

ListFilesRequest is the request made to browse the contents inside a directory

type ListFilesResponse

type ListFilesResponse struct {
	Name string `json:"name"`
	Type string `json:"type"` // Type could be dir or file
}

ListFilesResponse is the response given to browse the contents inside a directory

type LiveQueryOptions

type LiveQueryOptions struct {
	SkipInitial bool `json:"skipInitial"`
}

LiveQueryOptions is to set the options for realtime requests

type Message

type Message struct {
	Type string      `json:"type"`
	Data interface{} `json:"data"`
	ID   string      `json:"id"` // the request id
}

Message is the request body of the message

type MetricCrudHook

type MetricCrudHook func(project, dbAlias, col string, count int64, op OperationType)

MetricCrudHook is used to log a database operation

type MetricEventingHook

type MetricEventingHook func(project, eventingType string)

MetricEventingHook is used to log a eventing operation

type MetricFileHook

type MetricFileHook func(project, storeType string, op OperationType)

MetricFileHook is used to log a file operation

type MetricFunctionHook

type MetricFunctionHook func(project, service, function string)

MetricFunctionHook is used to log a function operation

type OperationType

type OperationType string

OperationType is the type of operation being performed on the database

const (
	// Create is the type used for insert operations
	Create OperationType = "create"

	// Read is the type used for query operation
	Read OperationType = "read"

	// List is the type used for file store list operation
	List OperationType = "list"

	// Update is the type used ofr update operations
	Update OperationType = "update"

	// Delete is the type used for delete operations
	Delete OperationType = "delete"

	// Batch is the type used for batch operations
	Batch OperationType = "batch"

	// Aggregation is the type used for aggregations
	Aggregation OperationType = "aggr"
)

type Port

type Port struct {
	Port     int     `json:"port" yaml:"port"`
	Name     *string `json:"name,omitempty" yaml:"name,omitempty"`
	Protocol *string `json:"protocol,omitempty" yaml:"protocol,omitempty"`
}

Port holds the container ports information

type PostProcess

type PostProcess struct {
	PostProcessAction []PostProcessAction
}

PostProcess filters the schema

type PostProcessAction

type PostProcessAction struct {
	Action string
	Field  string
	Value  interface{}
}

PostProcessAction is struct of Action Field Value

type PreparedQueryRequest

type PreparedQueryRequest struct {
	Params map[string]interface{} `json:"params"`
	// This field is used internally to show
	// _query meta data in the graphql
	Debug bool
}

PreparedQueryRequest is the http body received for a PreparedQuery request

type PubSubMessage

type PubSubMessage struct {
	ReplyTo string      `json:"replyTo"`
	Payload interface{} `json:"payload"`
}

PubSubMessage describes the format of pubsub send message

func (*PubSubMessage) Unmarshal

func (m *PubSubMessage) Unmarshal(ptr interface{}) error

Unmarshal parses the payload into the object provided

type QueueEventRequest

type QueueEventRequest struct {
	Type          string            `json:"type"`                // The type of the event
	Delay         int64             `json:"delay,omitempty"`     // Time in seconds
	Timestamp     string            `json:"timestamp,omitempty"` // Milliseconds from unix epoch (UTC)
	Payload       interface{}       `json:"payload,omitempty"`   // Payload contains necessary event dat
	Options       map[string]string `json:"options"`
	IsSynchronous bool              `json:"isSynchronous"` // if true then client will wait for response of event
}

QueueEventRequest is the payload to add a new event to the task queue

type ReadOptions

type ReadOptions struct {
	// Debug field is used internally to show
	// _query meta data in the graphql
	Debug      bool             `json:"debug"`
	Select     map[string]int32 `json:"select"`
	Sort       []string         `json:"sort"`
	Skip       *int64           `json:"skip"`
	Limit      *int64           `json:"limit"`
	Distinct   *string          `json:"distinct"`
	Join       []*JoinOption    `json:"join"`
	ReturnType string           `json:"returnType"`
	HasOptions bool             `json:"hasOptions"` // used internally
}

ReadOptions is the options required for a read request

type ReadRequest

type ReadRequest struct {
	GroupBy     []interface{}            `json:"group"`
	Aggregate   map[string][]string      `json:"aggregate"`
	Find        map[string]interface{}   `json:"find"`
	Operation   string                   `json:"op"`
	Options     *ReadOptions             `json:"options"`
	IsBatch     bool                     `json:"isBatch"`
	Extras      map[string]interface{}   `json:"extras"`
	PostProcess map[string]*PostProcess  `json:"postProcess"`
	MatchWhere  []map[string]interface{} `json:"matchWhere"`
	Cache       *config.ReadCacheOptions `json:"cache"`
}

ReadRequest is the http body received for a read request

type ReadRequestKey

type ReadRequestKey struct {
	DBAlias    string
	Col        string
	DBType     string
	HasOptions bool
	Req        ReadRequest
	ReqParams  RequestParams
}

ReadRequestKey is the key type for the dataloader

func (ReadRequestKey) Raw

func (key ReadRequestKey) Raw() interface{}

Raw returns the raw, underlaying value of the key

func (ReadRequestKey) String

func (key ReadRequestKey) String() string

String returns a guaranteed unique string that can be used to identify an object

type RealtimeRequest

type RealtimeRequest struct {
	Token   string                 `json:"token"`
	DBType  string                 `json:"dbType"`
	Project string                 `json:"project"`
	Group   string                 `json:"group"` // Group is the collection name
	Type    string                 `json:"type"`  // Can either be subscribe or unsubscribe
	ID      string                 `json:"id"`    // id is the query id
	Where   map[string]interface{} `json:"where"`
	Options LiveQueryOptions       `json:"options"`
}

RealtimeRequest is the object sent for realtime requests

type RealtimeResponse

type RealtimeResponse struct {
	Group string      `json:"group,omitempty"` // Group is the collection name
	ID    string      `json:"id,omitempty"`    // id is the query id
	Ack   bool        `json:"ack"`
	Error string      `json:"error,omitempty"`
	Docs  []*FeedData `json:"docs,omitempty"`
}

RealtimeResponse is the object sent for realtime requests

type RegisterRequest

type RegisterRequest struct {
	ID     string `json:"id"` // This is the space cloud id
	Key    string `json:"key"`
	UserID string `json:"userId"`
	Mode   int    `json:"mode"`
}

RegisterRequest is the struct which carries the space cloud register payload

type RegisterResponse

type RegisterResponse struct {
	Ack   bool   `json:"ack"`
	Error string `json:"error"`
}

RegisterResponse is the response to the register request

type RenewLicense

type RenewLicense struct {
	ClusterName      string `json:"clusterName"`
	LicenseValue     string `json:"licenseValue"`
	LicenseKey       string `json:"licenseKey"`
	License          string `json:"license"`
	CurrentSessionID string `json:"sessionId"`
}

RenewLicense is the body for renew license request

type RequestParams

type RequestParams struct {
	RequestID  string                 `json:"requestId"`
	Resource   string                 `json:"resource"`
	Op         string                 `json:"op"`
	Attributes map[string]string      `json:"attributes"`
	Headers    http.Header            `json:"headers"`
	Claims     map[string]interface{} `json:"claims"`
	Method     string                 `json:"method"`
	Path       string                 `json:"path"`
	Payload    interface{}            `json:"payload"`
}

RequestParams describes the params passed down in every request

type Response

type Response struct {
	Error  string      `json:"error,omitempty"`
	Result interface{} `json:"result,omitempty"`
}

Response is the object returned by every handler to client

type ReturnWhereStub

type ReturnWhereStub struct {
	Where         map[string]interface{}
	ReturnWhere   bool
	Col           string
	PrefixColName bool
}

ReturnWhereStub describes return where stuff

type Runtime

type Runtime struct {
	Name    string `json:"name" yaml:"name"`
	Install string `json:"install" yaml:"install"`
	Run     string `json:"run" yaml:"run"`
}

Runtime holds the runtime information

type SQLMetaData

type SQLMetaData struct {
	Col       string        `json:"col" structs:"col"`
	SQL       string        `json:"sql" structs:"sql"`
	DbAlias   string        `json:"db" structs:"db"`
	Args      []interface{} `json:"args" structs:"args"`
	QueryTime string        `json:"queryTime" structs:"queryTime"`
}

SQLMetaData stores sql query information

type ScServices

type ScServices []*Service

ScServices stores array of gateway services

func (ScServices) Len

func (a ScServices) Len() int

func (ScServices) Less

func (a ScServices) Less(i, j int) bool

func (ScServices) Swap

func (a ScServices) Swap(i, j int)

type SchemaCrudInterface

type SchemaCrudInterface interface {
	SetDatabaseSchema(dbSchemas config.DatabaseSchemas, project string) error
	ValidateCreateOperation(ctx context.Context, dbType, col string, req *CreateRequest) error
	ValidateUpdateOperation(ctx context.Context, dbType, col, op string, updateDoc, find map[string]interface{}) error
	CrudPostProcess(ctx context.Context, dbAlias, col string, result interface{}) error
	AdjustWhereClause(ctx context.Context, dbAlias string, dbType DBType, col string, find map[string]interface{}) error
}

SchemaCrudInterface is an interface consisting of functions of schema module used by auth module

type SchemaEventingInterface

type SchemaEventingInterface interface {
	SchemaModifyAll(ctx context.Context, dbAlias, logicalDBName string, dbSchemas config.DatabaseSchemas) error
	SchemaInspection(ctx context.Context, dbAlias, project, col string, realSchema Collection) (string, error)
	GetSchema(dbAlias, col string) (Fields, bool)
	GetSchemaForDB(ctx context.Context, dbAlias, col, format string) ([]interface{}, error)
}

SchemaEventingInterface is an interface consisting of functions of schema module used by eventing module

type SendFeed

type SendFeed func(*FeedData)

SendFeed is the function called whenever a data point (feed) is to be sent

type Service

type Service struct {
	ID string
}

Service stores id of the service

type SpecObject

type SpecObject struct {
	API  string            `json:"api" yaml:"api"`
	Type string            `json:"type" yaml:"type"`
	Meta map[string]string `json:"meta" yaml:"meta"`
	Spec interface{}       `json:"spec" yaml:"spec,omitempty"`
}

SpecObject describes the basic structure of config specifications

type StageEventHook

type StageEventHook func(ctx context.Context, intent *EventIntent, err error)

StageEventHook is used to stage an intended event

type SyncManAdminInterface

type SyncManAdminInterface interface {
	CheckIfLeaderGateway(nodeID string) (bool, error)
}

SyncManAdminInterface is an interface consisting of functions of synman module used by auth admin module

type SyncmanEventingInterface

type SyncmanEventingInterface interface {
	GetAssignedSpaceCloudID(ctx context.Context, project string, token int) (string, error)
	GetAssignedTokens() (start, end int)
	GetEventSource() string
	GetSpaceCloudPort() int
	GetNodeID() string
	MakeHTTPRequest(ctx context.Context, method, url, token, scToken string, params, vPtr interface{}) error
}

SyncmanEventingInterface is an interface consisting of functions of syncman module used by eventing module

type TableProperties

type TableProperties struct {
	// IsIndex tells us if this is an indexed column
	IsIndex bool `json:"isIndex"`
	// IsUnique tells us if this is an unique indexed column
	IsUnique       bool `json:"isUnique"`
	From           string
	To             string
	Table          string
	Field          string
	OnDelete       string
	DBType         string
	Group          string
	Sort           string
	Order          int
	ConstraintName string
}

TableProperties are properties of the table

type TokenClaims

type TokenClaims map[string]interface{}

TokenClaims specifies the tokens and its claims

type Type

type Type map[string]Collection // key is database name

Type is the data structure for storing the parsed values of schema string

type UpdateIntentHook

type UpdateIntentHook func(ctx context.Context, dbAlias, col string, req *UpdateRequest) (*EventIntent, error)

UpdateIntentHook is used to log a create intent

type UpdateRequest

type UpdateRequest struct {
	Find      map[string]interface{} `json:"find"`
	Operation string                 `json:"op"`
	Update    map[string]interface{} `json:"update"`
}

UpdateRequest is the http body received for an update request

type UpgradeResponse

type UpgradeResponse struct {
	Error   string `json:"error"`
	License string `json:"license"`
}

UpgradeResponse is the response of upgrade request

type UploadResponse

type UploadResponse struct {
	Error  string  `json:"error"`
	Config *Deploy `json:"config,omitempty"`
}

UploadResponse is the response received from the registry

type UsageQuotas

type UsageQuotas struct {
	MaxProjects      int     `json:"maxProjects"`
	MaxDatabases     int     `json:"maxDatabases"`
	IntegrationLevel float64 `json:"integrationLevel"`
}

UsageQuotas describes the usage quotas

type UsageQuotasResult

type UsageQuotasResult struct {
	Result UsageQuotas `json:"result"`
	Error  string      `json:"error"`
}

UsageQuotasResult describes the response received for fetch quota operation

Jump to

Keyboard shortcuts

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