shared

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationCache

type ApplicationCache struct {
	Project     *protobuff.Project      `json:"project,omitempty"`
	Param       *CommonSystemParams     `json:"param,omitempty"`
	RawSchemas  *RawSchema              `json:"raw_schema,omitempty"`
	Dataloaders map[string]*dlv6.Loader `json:"dataloaders,omitempty"`

	IncomingRequest []*IncomingRequest `json:"incoming_request"`
}

type CacheDBConfig added in v0.0.3

type CacheDBConfig struct {
	DB       *CommonDatabaseConfig
	CacheTTL string
}

type CommonDatabaseConfig added in v0.0.3

type CommonDatabaseConfig struct {
	Host     string
	Port     string
	User     string
	Password string
	Database string
}

type CommonSystemParams

type CommonSystemParams struct {
	UserId        string `json:"user_id,omitempty"`
	RelationModel string `json:"relation_model,omitempty"`
	Email         string `json:"email,omitempty"`
	ProjectId     string `json:"project_id,omitempty"`
	TenantId      string `json:"tenant_id,omitempty"`

	ResolveParams *graphql.ResolveParams `json:"resolve_params,omitempty"`

	SystemCollectionName string `json:"system_collection_name,omitempty"`

	DocumentId  string   `json:"document_id,omitempty"`
	DocumentIDs []string `json:"document_ids,omitempty"`

	Document    *DefaultDocumentStructure `json:"document,omitempty"`
	Model       *protobuff.ModelType      `json:"model_type,omitempty"`
	ConDisParam []*ConnectDisconnectParam `json:"con_dis_param,omitempty"`
	FieldInfo   *protobuff.FieldInfo      `json:"field_info,omitempty"`

	KnownAs        string `json:"known_as,omitempty"`
	Revision       bool   `json:"revision,omitempty"`
	SinglePageData bool   `json:"single_page_data,omitempty"`

	IsSystemRequest bool `json:"is_system_request,omitempty"`

	IsEntireCollectionSearchRequest bool `json:"is_entire_collection_search_request,omitempty"`

	IsDataloaderRequest bool `json:"is_dataloader_request,omitempty"`

	IsIntersectionResult bool `json:"is_intersection_result,omitempty"`

	OnlyReturnCount bool `json:"only_return_count,omitempty"`

	// these three used in intersection of two collections
	SkipSort       bool `json:"skip_sort,omitempty"`
	SkipPagination bool `json:"skip_pagination,omitempty"`
	ReturnOnlyID   bool `json:"return_only_id,omitempty"`

	QuerySelectionSets *ast.SelectionSet `json:"query_selection_sets,omitempty"`

	UnmarshalStructure interface{} `json:"unmarshal_structure"`
}

type ConnectDisconnectParam

type ConnectDisconnectParam struct {
	DocCollectionName string
	DocRelationName   string

	ConnectionIds       []string
	ConnectionType      string
	ForwardConnectionId string

	ForwardConnectionType      *protobuff.ConnectionType
	ForwardConnectionModelType *protobuff.ModelType

	BackwardConnectionType     *protobuff.ConnectionType
	BackendConnectionModelType *protobuff.ModelType

	KnownAs string
}

type DBPaginationFilter added in v0.0.3

type DBPaginationFilter struct {
	Total int `json:"total"`
	Page  int `json:"page"`
	Limit int `json:"limit"`
}

type DataLoaders

type DataLoaders struct {
	MultiLoader *dataloader.Loader[string, interface{}]
}

DataLoaders Dataloaders

type DataloaderResult

type DataloaderResult[T any] struct {
	Result  []T  `json:"result"`
	Count   int  `json:"count"`
	Cached  bool `json:"cached"`
	HasMore bool `json:"hasMore"`
	Error   bool `json:"error"`
	Code    int  `json:"code"`
}

type DefaultDocumentStructure

type DefaultDocumentStructure struct {
	Key      string                 `json:"_key,omitempty" firestore:"_key,omitempty"`
	Id       string                 `json:"id,omitempty" firestore:"id,omitempty"`
	Type     string                 `json:"type,omitempty" firestore:"type,omitempty"`
	Data     map[string]interface{} `json:"data,omitempty" firestore:"data,omitempty"`
	Meta     *protobuff.MetaField   `json:"meta,omitempty" firestore:"meta,omitempty"`
	ExpireAt string                 `json:"expire_at,omitempty" firestore:"expire_at,omitempty"`
}

type DocumentRevisionHistory

type DocumentRevisionHistory struct {
	Id         string `json:"id"`
	RevisionAt string `json:"revision_at"`
	Status     string `json:"status"`
}

type EdgeRelation

type EdgeRelation struct {
	XFrom       string   `json:"_from,omitempty"`
	XTo         string   `json:"_to,omitempty"`
	Key         string   `json:"_key,omitempty"`
	Relation    string   `json:"relation,omitempty"`
	From        string   `json:"from,omitempty"`
	To          string   `json:"to,omitempty"`
	CreatedAt   string   `json:"created_at,omitempty"`
	KnownAs     string   `json:"known_as,omitempty"`
	Permissions []string `json:"permissions,omitempty"`
}

type FieldDetails added in v0.0.3

type FieldDetails struct {
	Kind      reflect.Kind
	SubFields []*protobuff.FieldInfo
	Local     string

	FieldType  string
	Validation *protobuff.Validation
	Value      interface{}
}

type Filter added in v0.0.3

type Filter struct {
	KeyWrapperFunction     string      `json:"keyWrapperFunction"`     // LOWER(x.name)
	Variable               string      `json:"variable"`               // x
	Key                    string      `json:"key"`                    // name
	Condition              string      `json:"condition"`              // ==
	Value                  interface{} `json:"value"`                  // fahim
	ComplexPredefinedQuery string      `json:"complexPredefinedQuery"` // for array filter -> COUNT(array[* FILTER CONTAINS(name, CURRENT)])
}

type FilterInformation added in v0.0.3

type FilterInformation struct {
	Condition string    `json:"condition"`
	Filters   []*Filter `json:"filters"`
}

type FilteredModel

type FilteredModel struct {
	Name              string
	WhereFilter       []string
	IsConnectionQuery bool
	HasMetaQuery      bool
}

type IncomingRequest

type IncomingRequest struct {
	OperationType  string
	FilteredModels []*FilteredModel
	IsFunction     bool
}

type ModelDocsResponse

type ModelDocsResponse struct {
	Docs  []*DefaultDocumentStructure `json:"docs"`
	Count int                         `json:"count"`
}

type QueryBuilder added in v0.0.3

type QueryBuilder struct {
	RawFilterData map[string]interface{}

	UserID                   string   `json:"user_id"`
	TenantID                 string   `json:"tenant_id"`
	ProjectID                string   `json:"project_id"`
	RootCollectionFilterType string   `json:"doc_filter_type"`
	DocumentID               string   `json:"document_id"`
	DocumentIDs              []string `json:"document_ids"`

	ParentVariableName string `json:"parent_variable_name"`
	VariablePrefix     string `json:"variable_prefix"`
	VariableName       string `json:"variable_name"`
	CollectionName     string `json:"main_collection_name"`

	DefaultFilterCondition string               `json:"filter_condition"`
	WhereFilter            []*FilterInformation `json:"where_filter"`
	SortFilter             []*Filter            `json:"sort_and_limit_param"`
	PaginationFilter       *DBPaginationFilter  `json:"limit_filter"`
	FilterByLocal          string               `json:"local"`
	FilterByStatus         string               `json:"status"`

	ConnectionFilter map[string]interface{} `json:"connection_filter"`

	ApitoFields []*protobuff.FieldInfo `json:"apito_fields"`

	//QueryFilters  []*FilterInformation     `json:"query_filters"`
	SubQueries    []*QueryBuilder          `json:"sub_queries"`
	NestedQueries []*QueryBuilder          `json:"nested_queries"`
	ReturnFields  map[string]*FieldDetails `json:"return_fields"`

	ReturnFieldsSelection *ast.SelectionSet `json:"return_fields_selection"`

	IncludeDefaultSortAndLimit bool `json:"include_default_sort_and_limit"`
	IntersectResult            bool `json:"intersect_result"`
	FetchRevisionDocumentsOnly bool `json:"fetch_revision_documents_only"`
	IsDataloaderQuery          bool `json:"is_dataloader_query"`
	IsSystemRequest            bool `json:"is_system_query"`
	IsSystemCollectionQuery    bool `json:"is_system_collection_query"`
	IsEntireCollectionQuery    bool `json:"is_entire_collection_query"`
	SkipSort                   bool `json:"skip_sort"`
	SkipPagination             bool `json:"skip_limit"`
	ReturnOnlyID               bool `json:"return_only_id"`
}

type RawSchema

type RawSchema struct {
	Queries   graphql.Fields
	Mutations graphql.Fields
}

type Response

type Response struct {
	Data       interface{}            `json:"data,omitempty"`
	Errors     json.RawMessage        `json:"errors,omitempty"`
	Extensions map[string]interface{} `json:"extensions,omitempty"`
}

type SearchResponse

type SearchResponse[T any] struct {
	Results        []*T
	GroupedResults map[string][]*T
}

type SystemDBConfig added in v0.0.3

type SystemDBConfig struct {
	DB          *CommonDatabaseConfig
	LocalDBPath string
}

Jump to

Keyboard shortcuts

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