api

package
v1.0.0-alpha.9 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 24 Imported by: 4

Documentation

Overview

Package api is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package api is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_server_v1_api_proto protoreflect.FileDescriptor
View Source
var File_server_v1_health_proto protoreflect.FileDescriptor
View Source
var HealthAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "HealthAPI",
	HandlerType: (*HealthAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Health",
			Handler:    _HealthAPI_Health_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "server/v1/health.proto",
}

HealthAPI_ServiceDesc is the grpc.ServiceDesc for HealthAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var Tigris_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Tigris",
	HandlerType: (*TigrisServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "BeginTransaction",
			Handler:    _Tigris_BeginTransaction_Handler,
		},
		{
			MethodName: "CommitTransaction",
			Handler:    _Tigris_CommitTransaction_Handler,
		},
		{
			MethodName: "RollbackTransaction",
			Handler:    _Tigris_RollbackTransaction_Handler,
		},
		{
			MethodName: "Insert",
			Handler:    _Tigris_Insert_Handler,
		},
		{
			MethodName: "Replace",
			Handler:    _Tigris_Replace_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _Tigris_Delete_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _Tigris_Update_Handler,
		},
		{
			MethodName: "CreateOrUpdateCollection",
			Handler:    _Tigris_CreateOrUpdateCollection_Handler,
		},
		{
			MethodName: "DropCollection",
			Handler:    _Tigris_DropCollection_Handler,
		},
		{
			MethodName: "ListDatabases",
			Handler:    _Tigris_ListDatabases_Handler,
		},
		{
			MethodName: "ListCollections",
			Handler:    _Tigris_ListCollections_Handler,
		},
		{
			MethodName: "CreateDatabase",
			Handler:    _Tigris_CreateDatabase_Handler,
		},
		{
			MethodName: "DropDatabase",
			Handler:    _Tigris_DropDatabase_Handler,
		},
		{
			MethodName: "DescribeDatabase",
			Handler:    _Tigris_DescribeDatabase_Handler,
		},
		{
			MethodName: "DescribeCollection",
			Handler:    _Tigris_DescribeCollection_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Read",
			Handler:       _Tigris_Read_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Stream",
			Handler:       _Tigris_Stream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "server/v1/api.proto",
}

Tigris_ServiceDesc is the grpc.ServiceDesc for Tigris service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func MarshalStatus

func MarshalStatus(status *spb.Status) ([]byte, error)

MarshalStatus marshal status object

func RegisterHealthAPIHandler

func RegisterHealthAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterHealthAPIHandler registers the http handlers for service HealthAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterHealthAPIHandlerClient

func RegisterHealthAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HealthAPIClient) error

RegisterHealthAPIHandlerClient registers the http handlers for service HealthAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HealthAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HealthAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "HealthAPIClient" to call the correct interceptors.

func RegisterHealthAPIHandlerFromEndpoint

func RegisterHealthAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterHealthAPIHandlerFromEndpoint is same as RegisterHealthAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterHealthAPIHandlerServer

func RegisterHealthAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HealthAPIServer) error

RegisterHealthAPIHandlerServer registers the http handlers for service HealthAPI to "mux". UnaryRPC :call HealthAPIServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterHealthAPIHandlerFromEndpoint instead.

func RegisterHealthAPIServer

func RegisterHealthAPIServer(s grpc.ServiceRegistrar, srv HealthAPIServer)

func RegisterTigrisHandler

func RegisterTigrisHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterTigrisHandler registers the http handlers for service Tigris to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterTigrisHandlerClient

func RegisterTigrisHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TigrisClient) error

RegisterTigrisHandlerClient registers the http handlers for service Tigris to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TigrisClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TigrisClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TigrisClient" to call the correct interceptors.

func RegisterTigrisHandlerFromEndpoint

func RegisterTigrisHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterTigrisHandlerFromEndpoint is same as RegisterTigrisHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterTigrisHandlerServer

func RegisterTigrisHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TigrisServer) error

RegisterTigrisHandlerServer registers the http handlers for service Tigris to "mux". UnaryRPC :call TigrisServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTigrisHandlerFromEndpoint instead.

func RegisterTigrisServer

func RegisterTigrisServer(s grpc.ServiceRegistrar, srv TigrisServer)

Types

type BeginTransactionRequest

type BeginTransactionRequest struct {

	// Database name this transaction belongs to.
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// The transaction options.
	Options *TransactionOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

Start new transaction in database specified by "db".

func (*BeginTransactionRequest) Descriptor deprecated

func (*BeginTransactionRequest) Descriptor() ([]byte, []int)

Deprecated: Use BeginTransactionRequest.ProtoReflect.Descriptor instead.

func (*BeginTransactionRequest) GetDb

func (x *BeginTransactionRequest) GetDb() string

func (*BeginTransactionRequest) GetOptions

func (*BeginTransactionRequest) ProtoMessage

func (*BeginTransactionRequest) ProtoMessage()

func (*BeginTransactionRequest) ProtoReflect

func (x *BeginTransactionRequest) ProtoReflect() protoreflect.Message

func (*BeginTransactionRequest) Reset

func (x *BeginTransactionRequest) Reset()

func (*BeginTransactionRequest) String

func (x *BeginTransactionRequest) String() string

type BeginTransactionResponse

type BeginTransactionResponse struct {

	// Returns a tigris transactional context with details about the transactions.
	TxCtx *TransactionCtx `protobuf:"bytes,1,opt,name=tx_ctx,json=txCtx,proto3" json:"tx_ctx,omitempty"`
	// contains filtered or unexported fields
}

Start transaction returns transaction context which uniquely identifies the transaction

func (*BeginTransactionResponse) Descriptor deprecated

func (*BeginTransactionResponse) Descriptor() ([]byte, []int)

Deprecated: Use BeginTransactionResponse.ProtoReflect.Descriptor instead.

func (*BeginTransactionResponse) GetTxCtx

func (*BeginTransactionResponse) ProtoMessage

func (*BeginTransactionResponse) ProtoMessage()

func (*BeginTransactionResponse) ProtoReflect

func (x *BeginTransactionResponse) ProtoReflect() protoreflect.Message

func (*BeginTransactionResponse) Reset

func (x *BeginTransactionResponse) Reset()

func (*BeginTransactionResponse) String

func (x *BeginTransactionResponse) String() string

type CollectionDescription

type CollectionDescription struct {

	// Name of the collection.
	Collection string `protobuf:"bytes,1,opt,name=collection,proto3" json:"collection,omitempty"`
	// Metadata about the collection.
	Metadata *CollectionMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// Collections schema
	Schema []byte `protobuf:"bytes,3,opt,name=schema,proto3" json:"schema,omitempty"`
	// contains filtered or unexported fields
}

func (*CollectionDescription) Descriptor deprecated

func (*CollectionDescription) Descriptor() ([]byte, []int)

Deprecated: Use CollectionDescription.ProtoReflect.Descriptor instead.

func (*CollectionDescription) GetCollection

func (x *CollectionDescription) GetCollection() string

func (*CollectionDescription) GetMetadata

func (x *CollectionDescription) GetMetadata() *CollectionMetadata

func (*CollectionDescription) GetSchema

func (x *CollectionDescription) GetSchema() []byte

func (*CollectionDescription) ProtoMessage

func (*CollectionDescription) ProtoMessage()

func (*CollectionDescription) ProtoReflect

func (x *CollectionDescription) ProtoReflect() protoreflect.Message

func (*CollectionDescription) Reset

func (x *CollectionDescription) Reset()

func (*CollectionDescription) String

func (x *CollectionDescription) String() string

type CollectionInfo

type CollectionInfo struct {

	// Collection name.
	Collection string `protobuf:"bytes,1,opt,name=collection,proto3" json:"collection,omitempty"`
	// Metadata about the collection.
	Metadata *CollectionMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

func (*CollectionInfo) Descriptor deprecated

func (*CollectionInfo) Descriptor() ([]byte, []int)

Deprecated: Use CollectionInfo.ProtoReflect.Descriptor instead.

func (*CollectionInfo) GetCollection

func (x *CollectionInfo) GetCollection() string

func (*CollectionInfo) GetMetadata

func (x *CollectionInfo) GetMetadata() *CollectionMetadata

func (*CollectionInfo) ProtoMessage

func (*CollectionInfo) ProtoMessage()

func (*CollectionInfo) ProtoReflect

func (x *CollectionInfo) ProtoReflect() protoreflect.Message

func (*CollectionInfo) Reset

func (x *CollectionInfo) Reset()

func (*CollectionInfo) String

func (x *CollectionInfo) String() string

type CollectionMetadata

type CollectionMetadata struct {
	// contains filtered or unexported fields
}

func (*CollectionMetadata) Descriptor deprecated

func (*CollectionMetadata) Descriptor() ([]byte, []int)

Deprecated: Use CollectionMetadata.ProtoReflect.Descriptor instead.

func (*CollectionMetadata) ProtoMessage

func (*CollectionMetadata) ProtoMessage()

func (*CollectionMetadata) ProtoReflect

func (x *CollectionMetadata) ProtoReflect() protoreflect.Message

func (*CollectionMetadata) Reset

func (x *CollectionMetadata) Reset()

func (*CollectionMetadata) String

func (x *CollectionMetadata) String() string

type CollectionOptions

type CollectionOptions struct {

	// Perform operation in the context of this transaction.
	TxCtx *TransactionCtx `protobuf:"bytes,1,opt,name=tx_ctx,json=txCtx,proto3" json:"tx_ctx,omitempty"`
	// contains filtered or unexported fields
}

Collection requests modifying options.

func (*CollectionOptions) Descriptor deprecated

func (*CollectionOptions) Descriptor() ([]byte, []int)

Deprecated: Use CollectionOptions.ProtoReflect.Descriptor instead.

func (*CollectionOptions) GetTxCtx

func (x *CollectionOptions) GetTxCtx() *TransactionCtx

func (*CollectionOptions) ProtoMessage

func (*CollectionOptions) ProtoMessage()

func (*CollectionOptions) ProtoReflect

func (x *CollectionOptions) ProtoReflect() protoreflect.Message

func (*CollectionOptions) Reset

func (x *CollectionOptions) Reset()

func (*CollectionOptions) String

func (x *CollectionOptions) String() string

type CommitTransactionRequest

type CommitTransactionRequest struct {

	// Database name this transaction belongs to.
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// Tigris transactional context with details about the transactions.
	TxCtx *TransactionCtx `protobuf:"bytes,2,opt,name=tx_ctx,json=txCtx,proto3" json:"tx_ctx,omitempty"`
	// contains filtered or unexported fields
}

Commit transaction with the given ID

func (*CommitTransactionRequest) Descriptor deprecated

func (*CommitTransactionRequest) Descriptor() ([]byte, []int)

Deprecated: Use CommitTransactionRequest.ProtoReflect.Descriptor instead.

func (*CommitTransactionRequest) GetDb

func (x *CommitTransactionRequest) GetDb() string

func (*CommitTransactionRequest) GetTxCtx

func (*CommitTransactionRequest) ProtoMessage

func (*CommitTransactionRequest) ProtoMessage()

func (*CommitTransactionRequest) ProtoReflect

func (x *CommitTransactionRequest) ProtoReflect() protoreflect.Message

func (*CommitTransactionRequest) Reset

func (x *CommitTransactionRequest) Reset()

func (*CommitTransactionRequest) String

func (x *CommitTransactionRequest) String() string

type CommitTransactionResponse

type CommitTransactionResponse struct {

	// Status of commit transaction operation.
	Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*CommitTransactionResponse) Descriptor deprecated

func (*CommitTransactionResponse) Descriptor() ([]byte, []int)

Deprecated: Use CommitTransactionResponse.ProtoReflect.Descriptor instead.

func (*CommitTransactionResponse) GetStatus

func (x *CommitTransactionResponse) GetStatus() string

func (*CommitTransactionResponse) ProtoMessage

func (*CommitTransactionResponse) ProtoMessage()

func (*CommitTransactionResponse) ProtoReflect

func (*CommitTransactionResponse) Reset

func (x *CommitTransactionResponse) Reset()

func (*CommitTransactionResponse) String

func (x *CommitTransactionResponse) String() string

type CreateDatabaseRequest

type CreateDatabaseRequest struct {

	// Create database with this name.
	Db      string           `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	Options *DatabaseOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateDatabaseRequest) Descriptor deprecated

func (*CreateDatabaseRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateDatabaseRequest.ProtoReflect.Descriptor instead.

func (*CreateDatabaseRequest) GetDb

func (x *CreateDatabaseRequest) GetDb() string

func (*CreateDatabaseRequest) GetOptions

func (x *CreateDatabaseRequest) GetOptions() *DatabaseOptions

func (*CreateDatabaseRequest) ProtoMessage

func (*CreateDatabaseRequest) ProtoMessage()

func (*CreateDatabaseRequest) ProtoReflect

func (x *CreateDatabaseRequest) ProtoReflect() protoreflect.Message

func (*CreateDatabaseRequest) Reset

func (x *CreateDatabaseRequest) Reset()

func (*CreateDatabaseRequest) String

func (x *CreateDatabaseRequest) String() string

type CreateDatabaseResponse

type CreateDatabaseResponse struct {

	// A detailed response message.
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// An enum with value set as "created".
	Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateDatabaseResponse) Descriptor deprecated

func (*CreateDatabaseResponse) Descriptor() ([]byte, []int)

Deprecated: Use CreateDatabaseResponse.ProtoReflect.Descriptor instead.

func (*CreateDatabaseResponse) GetMessage

func (x *CreateDatabaseResponse) GetMessage() string

func (*CreateDatabaseResponse) GetStatus

func (x *CreateDatabaseResponse) GetStatus() string

func (*CreateDatabaseResponse) ProtoMessage

func (*CreateDatabaseResponse) ProtoMessage()

func (*CreateDatabaseResponse) ProtoReflect

func (x *CreateDatabaseResponse) ProtoReflect() protoreflect.Message

func (*CreateDatabaseResponse) Reset

func (x *CreateDatabaseResponse) Reset()

func (*CreateDatabaseResponse) String

func (x *CreateDatabaseResponse) String() string

type CreateOrUpdateCollectionRequest

type CreateOrUpdateCollectionRequest struct {

	// Database name where to create collection.
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// Collection name to create.
	Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"`
	// Schema of the documents in this collection. The schema specifications are same as
	// JSON schema specification defined <a href="https://json-schema.org/specification.html" title="here">here</a>.
	// <p></p>The following is an schema example:
	// `{
	//  "name": "user",
	//  "description": "Collection of documents with details of users",
	//  "properties": {
	//    "id": {
	//      "description": "A unique identifier for the user",
	//      "type": "integer"
	//    },
	//    "name": {
	//      "description": "Name of the user",
	//      "type": "string",
	//      "maxLength": 100
	//    },
	//    "balance": {
	//      "description": "User account balance",
	//      "type": "number"
	//    }
	//  },
	//  "primary_key": ["id"]
	// }`
	Schema     []byte             `protobuf:"bytes,3,opt,name=schema,proto3" json:"schema,omitempty"`
	OnlyCreate bool               `protobuf:"varint,4,opt,name=only_create,json=onlyCreate,proto3" json:"only_create,omitempty"`
	Options    *CollectionOptions `protobuf:"bytes,5,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateOrUpdateCollectionRequest) Descriptor deprecated

func (*CreateOrUpdateCollectionRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateOrUpdateCollectionRequest.ProtoReflect.Descriptor instead.

func (*CreateOrUpdateCollectionRequest) GetCollection

func (x *CreateOrUpdateCollectionRequest) GetCollection() string

func (*CreateOrUpdateCollectionRequest) GetDb

func (*CreateOrUpdateCollectionRequest) GetOnlyCreate

func (x *CreateOrUpdateCollectionRequest) GetOnlyCreate() bool

func (*CreateOrUpdateCollectionRequest) GetOptions

func (*CreateOrUpdateCollectionRequest) GetSchema

func (x *CreateOrUpdateCollectionRequest) GetSchema() []byte

func (*CreateOrUpdateCollectionRequest) ProtoMessage

func (*CreateOrUpdateCollectionRequest) ProtoMessage()

func (*CreateOrUpdateCollectionRequest) ProtoReflect

func (*CreateOrUpdateCollectionRequest) Reset

func (*CreateOrUpdateCollectionRequest) String

func (*CreateOrUpdateCollectionRequest) UnmarshalJSON

func (x *CreateOrUpdateCollectionRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON on CreateCollectionRequest avoids unmarshalling schema. The req handler deserializes the schema.

type CreateOrUpdateCollectionResponse

type CreateOrUpdateCollectionResponse struct {

	// A detailed response message.
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// An enum with value set as "created" or "updated"
	Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateOrUpdateCollectionResponse) Descriptor deprecated

func (*CreateOrUpdateCollectionResponse) Descriptor() ([]byte, []int)

Deprecated: Use CreateOrUpdateCollectionResponse.ProtoReflect.Descriptor instead.

func (*CreateOrUpdateCollectionResponse) GetMessage

func (x *CreateOrUpdateCollectionResponse) GetMessage() string

func (*CreateOrUpdateCollectionResponse) GetStatus

func (*CreateOrUpdateCollectionResponse) ProtoMessage

func (*CreateOrUpdateCollectionResponse) ProtoMessage()

func (*CreateOrUpdateCollectionResponse) ProtoReflect

func (*CreateOrUpdateCollectionResponse) Reset

func (*CreateOrUpdateCollectionResponse) String

type CustomMarshaler

type CustomMarshaler struct {
	*runtime.JSONBuiltin
}

CustomMarshaler is a marshaler to customize the response. Currently it is only used to marshal custom error message otherwise it just use the inbuilt mux marshaller.

func (*CustomMarshaler) Marshal

func (c *CustomMarshaler) Marshal(v interface{}) ([]byte, error)

type DatabaseDescription

type DatabaseDescription struct {
	// contains filtered or unexported fields
}

func (*DatabaseDescription) Descriptor deprecated

func (*DatabaseDescription) Descriptor() ([]byte, []int)

Deprecated: Use DatabaseDescription.ProtoReflect.Descriptor instead.

func (*DatabaseDescription) ProtoMessage

func (*DatabaseDescription) ProtoMessage()

func (*DatabaseDescription) ProtoReflect

func (x *DatabaseDescription) ProtoReflect() protoreflect.Message

func (*DatabaseDescription) Reset

func (x *DatabaseDescription) Reset()

func (*DatabaseDescription) String

func (x *DatabaseDescription) String() string

type DatabaseInfo

type DatabaseInfo struct {

	// Database name.
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// Metadata about the database. (ex. ...)
	Metadata *DatabaseMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

func (*DatabaseInfo) Descriptor deprecated

func (*DatabaseInfo) Descriptor() ([]byte, []int)

Deprecated: Use DatabaseInfo.ProtoReflect.Descriptor instead.

func (*DatabaseInfo) GetDb

func (x *DatabaseInfo) GetDb() string

func (*DatabaseInfo) GetMetadata

func (x *DatabaseInfo) GetMetadata() *DatabaseMetadata

func (*DatabaseInfo) ProtoMessage

func (*DatabaseInfo) ProtoMessage()

func (*DatabaseInfo) ProtoReflect

func (x *DatabaseInfo) ProtoReflect() protoreflect.Message

func (*DatabaseInfo) Reset

func (x *DatabaseInfo) Reset()

func (*DatabaseInfo) String

func (x *DatabaseInfo) String() string

type DatabaseMetadata

type DatabaseMetadata struct {
	// contains filtered or unexported fields
}

func (*DatabaseMetadata) Descriptor deprecated

func (*DatabaseMetadata) Descriptor() ([]byte, []int)

Deprecated: Use DatabaseMetadata.ProtoReflect.Descriptor instead.

func (*DatabaseMetadata) ProtoMessage

func (*DatabaseMetadata) ProtoMessage()

func (*DatabaseMetadata) ProtoReflect

func (x *DatabaseMetadata) ProtoReflect() protoreflect.Message

func (*DatabaseMetadata) Reset

func (x *DatabaseMetadata) Reset()

func (*DatabaseMetadata) String

func (x *DatabaseMetadata) String() string

type DatabaseOptions

type DatabaseOptions struct {
	// contains filtered or unexported fields
}

Database requests modifying options.

func (*DatabaseOptions) Descriptor deprecated

func (*DatabaseOptions) Descriptor() ([]byte, []int)

Deprecated: Use DatabaseOptions.ProtoReflect.Descriptor instead.

func (*DatabaseOptions) ProtoMessage

func (*DatabaseOptions) ProtoMessage()

func (*DatabaseOptions) ProtoReflect

func (x *DatabaseOptions) ProtoReflect() protoreflect.Message

func (*DatabaseOptions) Reset

func (x *DatabaseOptions) Reset()

func (*DatabaseOptions) String

func (x *DatabaseOptions) String() string

type DeleteRequest

type DeleteRequest struct {

	// Database name where to insert documents.
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// Collection name where to insert documents.
	Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"`
	// Delete documents which matching specified filter.
	// A filter can simply be key, value where key
	// is the field name and value would be the value for this field. Or a filter can be logical where
	// two or more fields can be logically joined using $or and $and. A few examples of filter:
	// <li> To delete a user document where the id has a value 1: “`{"id": 1 }“`
	// <li> To delete all the user documents where the key "id" has a value 1 or 2 or 3: `{"$or": [{"id": 1}, {"id": 2}, {"id": 3}]}`
	Filter  []byte                `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
	Options *DeleteRequestOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteRequest) Descriptor deprecated

func (*DeleteRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetCollection

func (x *DeleteRequest) GetCollection() string

func (*DeleteRequest) GetDb

func (x *DeleteRequest) GetDb() string

func (*DeleteRequest) GetFilter

func (x *DeleteRequest) GetFilter() []byte

func (*DeleteRequest) GetOptions

func (x *DeleteRequest) GetOptions() *DeleteRequestOptions

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

func (x *DeleteRequest) ProtoReflect() protoreflect.Message

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

func (*DeleteRequest) UnmarshalJSON

func (x *DeleteRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON on DeleteRequest avoids unmarshalling filter and instead this way we can write a custom struct to do the unmarshalling and will be avoiding any extra allocation/copying.

type DeleteRequestOptions

type DeleteRequestOptions struct {
	WriteOptions *WriteOptions `protobuf:"bytes,1,opt,name=write_options,json=writeOptions,proto3" json:"write_options,omitempty"`
	// contains filtered or unexported fields
}

Additional options for deleted requests.

func (*DeleteRequestOptions) Descriptor deprecated

func (*DeleteRequestOptions) Descriptor() ([]byte, []int)

Deprecated: Use DeleteRequestOptions.ProtoReflect.Descriptor instead.

func (*DeleteRequestOptions) GetWriteOptions

func (x *DeleteRequestOptions) GetWriteOptions() *WriteOptions

func (*DeleteRequestOptions) ProtoMessage

func (*DeleteRequestOptions) ProtoMessage()

func (*DeleteRequestOptions) ProtoReflect

func (x *DeleteRequestOptions) ProtoReflect() protoreflect.Message

func (*DeleteRequestOptions) Reset

func (x *DeleteRequestOptions) Reset()

func (*DeleteRequestOptions) String

func (x *DeleteRequestOptions) String() string

type DeleteResponse

type DeleteResponse struct {

	// Has metadata related to the documents stored.
	Metadata *ResponseMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// an enum with value set as "deleted"
	Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteResponse) Descriptor deprecated

func (*DeleteResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) GetMetadata

func (x *DeleteResponse) GetMetadata() *ResponseMetadata

func (*DeleteResponse) GetStatus

func (x *DeleteResponse) GetStatus() string

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

func (x *DeleteResponse) ProtoReflect() protoreflect.Message

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type DescribeCollectionRequest

type DescribeCollectionRequest struct {

	// Name of the database.
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// Name of the collection.
	Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"`
	// Collection options.
	Options *CollectionOptions `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*DescribeCollectionRequest) Descriptor deprecated

func (*DescribeCollectionRequest) Descriptor() ([]byte, []int)

Deprecated: Use DescribeCollectionRequest.ProtoReflect.Descriptor instead.

func (*DescribeCollectionRequest) GetCollection

func (x *DescribeCollectionRequest) GetCollection() string

func (*DescribeCollectionRequest) GetDb

func (x *DescribeCollectionRequest) GetDb() string

func (*DescribeCollectionRequest) GetOptions

func (*DescribeCollectionRequest) ProtoMessage

func (*DescribeCollectionRequest) ProtoMessage()

func (*DescribeCollectionRequest) ProtoReflect

func (*DescribeCollectionRequest) Reset

func (x *DescribeCollectionRequest) Reset()

func (*DescribeCollectionRequest) String

func (x *DescribeCollectionRequest) String() string

type DescribeCollectionResponse

type DescribeCollectionResponse struct {

	// Name of the collection.
	Collection string `protobuf:"bytes,1,opt,name=collection,proto3" json:"collection,omitempty"`
	// Metadata about the collection.
	Metadata *CollectionMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// Collections schema
	Schema []byte `protobuf:"bytes,3,opt,name=schema,proto3" json:"schema,omitempty"`
	// contains filtered or unexported fields
}

A detailed description about the collection. The description returns collection metadata and the schema.

func (*DescribeCollectionResponse) Descriptor deprecated

func (*DescribeCollectionResponse) Descriptor() ([]byte, []int)

Deprecated: Use DescribeCollectionResponse.ProtoReflect.Descriptor instead.

func (*DescribeCollectionResponse) GetCollection

func (x *DescribeCollectionResponse) GetCollection() string

func (*DescribeCollectionResponse) GetMetadata

func (*DescribeCollectionResponse) GetSchema

func (x *DescribeCollectionResponse) GetSchema() []byte

func (*DescribeCollectionResponse) MarshalJSON

func (x *DescribeCollectionResponse) MarshalJSON() ([]byte, error)

func (*DescribeCollectionResponse) ProtoMessage

func (*DescribeCollectionResponse) ProtoMessage()

func (*DescribeCollectionResponse) ProtoReflect

func (*DescribeCollectionResponse) Reset

func (x *DescribeCollectionResponse) Reset()

func (*DescribeCollectionResponse) String

func (x *DescribeCollectionResponse) String() string

type DescribeDatabaseRequest

type DescribeDatabaseRequest struct {

	// Name of the database.
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// contains filtered or unexported fields
}

func (*DescribeDatabaseRequest) Descriptor deprecated

func (*DescribeDatabaseRequest) Descriptor() ([]byte, []int)

Deprecated: Use DescribeDatabaseRequest.ProtoReflect.Descriptor instead.

func (*DescribeDatabaseRequest) GetDb

func (x *DescribeDatabaseRequest) GetDb() string

func (*DescribeDatabaseRequest) ProtoMessage

func (*DescribeDatabaseRequest) ProtoMessage()

func (*DescribeDatabaseRequest) ProtoReflect

func (x *DescribeDatabaseRequest) ProtoReflect() protoreflect.Message

func (*DescribeDatabaseRequest) Reset

func (x *DescribeDatabaseRequest) Reset()

func (*DescribeDatabaseRequest) String

func (x *DescribeDatabaseRequest) String() string

type DescribeDatabaseResponse

type DescribeDatabaseResponse struct {

	// Name of the database.
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// Metadata about the database.
	Metadata *DatabaseMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// A detailed description about all the collections.
	// The description returns collection metadata and the schema.
	Collections []*CollectionDescription `protobuf:"bytes,3,rep,name=collections,proto3" json:"collections,omitempty"`
	// contains filtered or unexported fields
}

A detailed description about the database and all associated collections. Description of the collection includes schema details as well.

func (*DescribeDatabaseResponse) Descriptor deprecated

func (*DescribeDatabaseResponse) Descriptor() ([]byte, []int)

Deprecated: Use DescribeDatabaseResponse.ProtoReflect.Descriptor instead.

func (*DescribeDatabaseResponse) GetCollections

func (x *DescribeDatabaseResponse) GetCollections() []*CollectionDescription

func (*DescribeDatabaseResponse) GetDb

func (x *DescribeDatabaseResponse) GetDb() string

func (*DescribeDatabaseResponse) GetMetadata

func (x *DescribeDatabaseResponse) GetMetadata() *DatabaseMetadata

func (*DescribeDatabaseResponse) MarshalJSON

func (x *DescribeDatabaseResponse) MarshalJSON() ([]byte, error)

func (*DescribeDatabaseResponse) ProtoMessage

func (*DescribeDatabaseResponse) ProtoMessage()

func (*DescribeDatabaseResponse) ProtoReflect

func (x *DescribeDatabaseResponse) ProtoReflect() protoreflect.Message

func (*DescribeDatabaseResponse) Reset

func (x *DescribeDatabaseResponse) Reset()

func (*DescribeDatabaseResponse) String

func (x *DescribeDatabaseResponse) String() string

type DropCollectionRequest

type DropCollectionRequest struct {

	// Database name of the collection.
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// Collection name to drop.
	Collection string             `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"`
	Options    *CollectionOptions `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*DropCollectionRequest) Descriptor deprecated

func (*DropCollectionRequest) Descriptor() ([]byte, []int)

Deprecated: Use DropCollectionRequest.ProtoReflect.Descriptor instead.

func (*DropCollectionRequest) GetCollection

func (x *DropCollectionRequest) GetCollection() string

func (*DropCollectionRequest) GetDb

func (x *DropCollectionRequest) GetDb() string

func (*DropCollectionRequest) GetOptions

func (x *DropCollectionRequest) GetOptions() *CollectionOptions

func (*DropCollectionRequest) ProtoMessage

func (*DropCollectionRequest) ProtoMessage()

func (*DropCollectionRequest) ProtoReflect

func (x *DropCollectionRequest) ProtoReflect() protoreflect.Message

func (*DropCollectionRequest) Reset

func (x *DropCollectionRequest) Reset()

func (*DropCollectionRequest) String

func (x *DropCollectionRequest) String() string

type DropCollectionResponse

type DropCollectionResponse struct {

	// A detailed response message.
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// An enum with value set as "dropped".
	Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*DropCollectionResponse) Descriptor deprecated

func (*DropCollectionResponse) Descriptor() ([]byte, []int)

Deprecated: Use DropCollectionResponse.ProtoReflect.Descriptor instead.

func (*DropCollectionResponse) GetMessage

func (x *DropCollectionResponse) GetMessage() string

func (*DropCollectionResponse) GetStatus

func (x *DropCollectionResponse) GetStatus() string

func (*DropCollectionResponse) ProtoMessage

func (*DropCollectionResponse) ProtoMessage()

func (*DropCollectionResponse) ProtoReflect

func (x *DropCollectionResponse) ProtoReflect() protoreflect.Message

func (*DropCollectionResponse) Reset

func (x *DropCollectionResponse) Reset()

func (*DropCollectionResponse) String

func (x *DropCollectionResponse) String() string

type DropDatabaseRequest

type DropDatabaseRequest struct {

	// Drop database with this name. **Note**: Deletes all the collections in the database.
	// Use with caution.
	Db      string           `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	Options *DatabaseOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*DropDatabaseRequest) Descriptor deprecated

func (*DropDatabaseRequest) Descriptor() ([]byte, []int)

Deprecated: Use DropDatabaseRequest.ProtoReflect.Descriptor instead.

func (*DropDatabaseRequest) GetDb

func (x *DropDatabaseRequest) GetDb() string

func (*DropDatabaseRequest) GetOptions

func (x *DropDatabaseRequest) GetOptions() *DatabaseOptions

func (*DropDatabaseRequest) ProtoMessage

func (*DropDatabaseRequest) ProtoMessage()

func (*DropDatabaseRequest) ProtoReflect

func (x *DropDatabaseRequest) ProtoReflect() protoreflect.Message

func (*DropDatabaseRequest) Reset

func (x *DropDatabaseRequest) Reset()

func (*DropDatabaseRequest) String

func (x *DropDatabaseRequest) String() string

type DropDatabaseResponse

type DropDatabaseResponse struct {

	// A detailed response message.
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// An enum with value set as "dropped".
	Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*DropDatabaseResponse) Descriptor deprecated

func (*DropDatabaseResponse) Descriptor() ([]byte, []int)

Deprecated: Use DropDatabaseResponse.ProtoReflect.Descriptor instead.

func (*DropDatabaseResponse) GetMessage

func (x *DropDatabaseResponse) GetMessage() string

func (*DropDatabaseResponse) GetStatus

func (x *DropDatabaseResponse) GetStatus() string

func (*DropDatabaseResponse) ProtoMessage

func (*DropDatabaseResponse) ProtoMessage()

func (*DropDatabaseResponse) ProtoReflect

func (x *DropDatabaseResponse) ProtoReflect() protoreflect.Message

func (*DropDatabaseResponse) Reset

func (x *DropDatabaseResponse) Reset()

func (*DropDatabaseResponse) String

func (x *DropDatabaseResponse) String() string

type ErrorDetails

type ErrorDetails struct {
	Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Msg  string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*ErrorDetails) Descriptor deprecated

func (*ErrorDetails) Descriptor() ([]byte, []int)

Deprecated: Use ErrorDetails.ProtoReflect.Descriptor instead.

func (*ErrorDetails) GetCode

func (x *ErrorDetails) GetCode() uint32

func (*ErrorDetails) GetMsg

func (x *ErrorDetails) GetMsg() string

func (*ErrorDetails) ProtoMessage

func (*ErrorDetails) ProtoMessage()

func (*ErrorDetails) ProtoReflect

func (x *ErrorDetails) ProtoReflect() protoreflect.Message

func (*ErrorDetails) Reset

func (x *ErrorDetails) Reset()

func (*ErrorDetails) String

func (x *ErrorDetails) String() string

type HealthAPIClient

type HealthAPIClient interface {
	Health(ctx context.Context, in *HealthCheckInput, opts ...grpc.CallOption) (*HealthCheckResponse, error)
}

HealthAPIClient is the client API for HealthAPI service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewHealthAPIClient

func NewHealthAPIClient(cc grpc.ClientConnInterface) HealthAPIClient

type HealthAPIServer

type HealthAPIServer interface {
	Health(context.Context, *HealthCheckInput) (*HealthCheckResponse, error)
}

HealthAPIServer is the server API for HealthAPI service. All implementations should embed UnimplementedHealthAPIServer for forward compatibility

type HealthCheckInput

type HealthCheckInput struct {
	// contains filtered or unexported fields
}

func (*HealthCheckInput) Descriptor deprecated

func (*HealthCheckInput) Descriptor() ([]byte, []int)

Deprecated: Use HealthCheckInput.ProtoReflect.Descriptor instead.

func (*HealthCheckInput) ProtoMessage

func (*HealthCheckInput) ProtoMessage()

func (*HealthCheckInput) ProtoReflect

func (x *HealthCheckInput) ProtoReflect() protoreflect.Message

func (*HealthCheckInput) Reset

func (x *HealthCheckInput) Reset()

func (*HealthCheckInput) String

func (x *HealthCheckInput) String() string

type HealthCheckResponse

type HealthCheckResponse struct {
	Response string `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
	// contains filtered or unexported fields
}

func (*HealthCheckResponse) Descriptor deprecated

func (*HealthCheckResponse) Descriptor() ([]byte, []int)

Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead.

func (*HealthCheckResponse) GetResponse

func (x *HealthCheckResponse) GetResponse() string

func (*HealthCheckResponse) ProtoMessage

func (*HealthCheckResponse) ProtoMessage()

func (*HealthCheckResponse) ProtoReflect

func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message

func (*HealthCheckResponse) Reset

func (x *HealthCheckResponse) Reset()

func (*HealthCheckResponse) String

func (x *HealthCheckResponse) String() string

type InsertRequest

type InsertRequest struct {

	// Database name where to insert documents.
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// Collection name where to insert documents.
	Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"`
	// Array of documents to insert. Each document is a JSON object.
	Documents [][]byte              `protobuf:"bytes,3,rep,name=documents,proto3" json:"documents,omitempty"`
	Options   *InsertRequestOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*InsertRequest) Descriptor deprecated

func (*InsertRequest) Descriptor() ([]byte, []int)

Deprecated: Use InsertRequest.ProtoReflect.Descriptor instead.

func (*InsertRequest) GetCollection

func (x *InsertRequest) GetCollection() string

func (*InsertRequest) GetDb

func (x *InsertRequest) GetDb() string

func (*InsertRequest) GetDocuments

func (x *InsertRequest) GetDocuments() [][]byte

func (*InsertRequest) GetOptions

func (x *InsertRequest) GetOptions() *InsertRequestOptions

func (*InsertRequest) ProtoMessage

func (*InsertRequest) ProtoMessage()

func (*InsertRequest) ProtoReflect

func (x *InsertRequest) ProtoReflect() protoreflect.Message

func (*InsertRequest) Reset

func (x *InsertRequest) Reset()

func (*InsertRequest) String

func (x *InsertRequest) String() string

func (*InsertRequest) UnmarshalJSON

func (x *InsertRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON on InsertRequest avoids unmarshalling user document. We only need to extract primary/index keys from the document and want to store the document as-is in the database. This way there is no extra cost of serialization/deserialization and also less error-prone because we are not touching the user document. The req handler needs to extract out the relevant keys from the user docs and should pass it as-is to the underlying engine.

type InsertRequestOptions

type InsertRequestOptions struct {
	WriteOptions *WriteOptions `protobuf:"bytes,1,opt,name=write_options,json=writeOptions,proto3" json:"write_options,omitempty"`
	// contains filtered or unexported fields
}

additional options for insert requests.

func (*InsertRequestOptions) Descriptor deprecated

func (*InsertRequestOptions) Descriptor() ([]byte, []int)

Deprecated: Use InsertRequestOptions.ProtoReflect.Descriptor instead.

func (*InsertRequestOptions) GetWriteOptions

func (x *InsertRequestOptions) GetWriteOptions() *WriteOptions

func (*InsertRequestOptions) ProtoMessage

func (*InsertRequestOptions) ProtoMessage()

func (*InsertRequestOptions) ProtoReflect

func (x *InsertRequestOptions) ProtoReflect() protoreflect.Message

func (*InsertRequestOptions) Reset

func (x *InsertRequestOptions) Reset()

func (*InsertRequestOptions) String

func (x *InsertRequestOptions) String() string

type InsertResponse

type InsertResponse struct {

	// Has metadata related to the documents stored.
	Metadata *ResponseMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// An enum with value set as "inserted"
	Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*InsertResponse) Descriptor deprecated

func (*InsertResponse) Descriptor() ([]byte, []int)

Deprecated: Use InsertResponse.ProtoReflect.Descriptor instead.

func (*InsertResponse) GetMetadata

func (x *InsertResponse) GetMetadata() *ResponseMetadata

func (*InsertResponse) GetStatus

func (x *InsertResponse) GetStatus() string

func (*InsertResponse) ProtoMessage

func (*InsertResponse) ProtoMessage()

func (*InsertResponse) ProtoReflect

func (x *InsertResponse) ProtoReflect() protoreflect.Message

func (*InsertResponse) Reset

func (x *InsertResponse) Reset()

func (*InsertResponse) String

func (x *InsertResponse) String() string

type ListCollectionsRequest

type ListCollectionsRequest struct {

	// List collection in this database.
	Db      string             `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	Options *CollectionOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*ListCollectionsRequest) Descriptor deprecated

func (*ListCollectionsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListCollectionsRequest.ProtoReflect.Descriptor instead.

func (*ListCollectionsRequest) GetDb

func (x *ListCollectionsRequest) GetDb() string

func (*ListCollectionsRequest) GetOptions

func (x *ListCollectionsRequest) GetOptions() *CollectionOptions

func (*ListCollectionsRequest) ProtoMessage

func (*ListCollectionsRequest) ProtoMessage()

func (*ListCollectionsRequest) ProtoReflect

func (x *ListCollectionsRequest) ProtoReflect() protoreflect.Message

func (*ListCollectionsRequest) Reset

func (x *ListCollectionsRequest) Reset()

func (*ListCollectionsRequest) String

func (x *ListCollectionsRequest) String() string

type ListCollectionsResponse

type ListCollectionsResponse struct {

	// Name of the database.
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// List of the collections info in the database.
	Collections []*CollectionInfo `protobuf:"bytes,2,rep,name=collections,proto3" json:"collections,omitempty"`
	// contains filtered or unexported fields
}

func (*ListCollectionsResponse) Descriptor deprecated

func (*ListCollectionsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListCollectionsResponse.ProtoReflect.Descriptor instead.

func (*ListCollectionsResponse) GetCollections

func (x *ListCollectionsResponse) GetCollections() []*CollectionInfo

func (*ListCollectionsResponse) GetDb

func (x *ListCollectionsResponse) GetDb() string

func (*ListCollectionsResponse) ProtoMessage

func (*ListCollectionsResponse) ProtoMessage()

func (*ListCollectionsResponse) ProtoReflect

func (x *ListCollectionsResponse) ProtoReflect() protoreflect.Message

func (*ListCollectionsResponse) Reset

func (x *ListCollectionsResponse) Reset()

func (*ListCollectionsResponse) String

func (x *ListCollectionsResponse) String() string

type ListDatabasesRequest

type ListDatabasesRequest struct {
	// contains filtered or unexported fields
}

func (*ListDatabasesRequest) Descriptor deprecated

func (*ListDatabasesRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListDatabasesRequest.ProtoReflect.Descriptor instead.

func (*ListDatabasesRequest) ProtoMessage

func (*ListDatabasesRequest) ProtoMessage()

func (*ListDatabasesRequest) ProtoReflect

func (x *ListDatabasesRequest) ProtoReflect() protoreflect.Message

func (*ListDatabasesRequest) Reset

func (x *ListDatabasesRequest) Reset()

func (*ListDatabasesRequest) String

func (x *ListDatabasesRequest) String() string

type ListDatabasesResponse

type ListDatabasesResponse struct {

	// List of the databases.
	Databases []*DatabaseInfo `protobuf:"bytes,1,rep,name=databases,proto3" json:"databases,omitempty"`
	// contains filtered or unexported fields
}

func (*ListDatabasesResponse) Descriptor deprecated

func (*ListDatabasesResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListDatabasesResponse.ProtoReflect.Descriptor instead.

func (*ListDatabasesResponse) GetDatabases

func (x *ListDatabasesResponse) GetDatabases() []*DatabaseInfo

func (*ListDatabasesResponse) ProtoMessage

func (*ListDatabasesResponse) ProtoMessage()

func (*ListDatabasesResponse) ProtoReflect

func (x *ListDatabasesResponse) ProtoReflect() protoreflect.Message

func (*ListDatabasesResponse) Reset

func (x *ListDatabasesResponse) Reset()

func (*ListDatabasesResponse) String

func (x *ListDatabasesResponse) String() string

type Metadata

type Metadata struct {
	CreatedAt *time.Time `json:"created_at,omitempty"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
}

func CreateMDFromResponseMD

func CreateMDFromResponseMD(x *ResponseMetadata) Metadata

type ReadRequest

type ReadRequest struct {

	// Database name to read documents from.
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// Collection name to read documents from.
	Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"`
	// Returns documents matching this filter.
	// A filter can simply be key, value where key
	// is the field name and value would be the value for this field. Or a filter can be logical where
	// two or more fields can be logically joined using $or and $and. A few examples of filter:
	// <li> To read a user document where the id has a value 1: “`{"id": 1 }“`
	// <li> To read all the user documents where the key "id" has a value 1 or 2 or 3: `{"$or": [{"id": 1}, {"id": 2}, {"id": 3}]}`
	Filter []byte `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
	// To read specific fields from a document. Default is all.
	Fields []byte `protobuf:"bytes,4,opt,name=fields,proto3" json:"fields,omitempty"`
	// Options that can be used to modify the results, for example "limit" to control the number of documents
	// returned by the server.
	Options *ReadRequestOptions `protobuf:"bytes,5,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadRequest) Descriptor deprecated

func (*ReadRequest) Descriptor() ([]byte, []int)

Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.

func (*ReadRequest) GetCollection

func (x *ReadRequest) GetCollection() string

func (*ReadRequest) GetDb

func (x *ReadRequest) GetDb() string

func (*ReadRequest) GetFields

func (x *ReadRequest) GetFields() []byte

func (*ReadRequest) GetFilter

func (x *ReadRequest) GetFilter() []byte

func (*ReadRequest) GetOptions

func (x *ReadRequest) GetOptions() *ReadRequestOptions

func (*ReadRequest) ProtoMessage

func (*ReadRequest) ProtoMessage()

func (*ReadRequest) ProtoReflect

func (x *ReadRequest) ProtoReflect() protoreflect.Message

func (*ReadRequest) Reset

func (x *ReadRequest) Reset()

func (*ReadRequest) String

func (x *ReadRequest) String() string

func (*ReadRequest) UnmarshalJSON

func (x *ReadRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON on ReadRequest avoids unmarshalling filter and instead this way we can write a custom struct to do the unmarshalling and will be avoiding any extra allocation/copying.

type ReadRequestOptions

type ReadRequestOptions struct {

	// Perform operation in the context of this transaction.
	TxCtx *TransactionCtx `protobuf:"bytes,1,opt,name=tx_ctx,json=txCtx,proto3" json:"tx_ctx,omitempty"`
	// Limit the number of documents returned by the read operation.
	Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	// Number of documents to skip before starting to return resulting documents.
	Skip int64 `protobuf:"varint,3,opt,name=skip,proto3" json:"skip,omitempty"`
	// A cursor for use in pagination. The next streams will return documents after this offset.
	Offset []byte `protobuf:"bytes,4,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

Options that can be used to modify the results, for example "limit" to control the number of documents returned by the server.

func (*ReadRequestOptions) Descriptor deprecated

func (*ReadRequestOptions) Descriptor() ([]byte, []int)

Deprecated: Use ReadRequestOptions.ProtoReflect.Descriptor instead.

func (*ReadRequestOptions) GetLimit

func (x *ReadRequestOptions) GetLimit() int64

func (*ReadRequestOptions) GetOffset

func (x *ReadRequestOptions) GetOffset() []byte

func (*ReadRequestOptions) GetSkip

func (x *ReadRequestOptions) GetSkip() int64

func (*ReadRequestOptions) GetTxCtx

func (x *ReadRequestOptions) GetTxCtx() *TransactionCtx

func (*ReadRequestOptions) ProtoMessage

func (*ReadRequestOptions) ProtoMessage()

func (*ReadRequestOptions) ProtoReflect

func (x *ReadRequestOptions) ProtoReflect() protoreflect.Message

func (*ReadRequestOptions) Reset

func (x *ReadRequestOptions) Reset()

func (*ReadRequestOptions) String

func (x *ReadRequestOptions) String() string

type ReadResponse

type ReadResponse struct {

	// Object containing the collection document.
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// An internal key, used for pagination.
	ResumeToken []byte `protobuf:"bytes,2,opt,name=resume_token,json=resumeToken,proto3" json:"resume_token,omitempty"`
	// Has metadata related to the documents stored.
	Metadata *ResponseMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadResponse) Descriptor deprecated

func (*ReadResponse) Descriptor() ([]byte, []int)

Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead.

func (*ReadResponse) GetData

func (x *ReadResponse) GetData() []byte

func (*ReadResponse) GetMetadata

func (x *ReadResponse) GetMetadata() *ResponseMetadata

func (*ReadResponse) GetResumeToken

func (x *ReadResponse) GetResumeToken() []byte

func (*ReadResponse) MarshalJSON

func (x *ReadResponse) MarshalJSON() ([]byte, error)

MarshalJSON on read response avoid any encoding/decoding on x.Data. With this approach we are not doing any extra marshaling/unmarshalling in returning the data from the database. The document returned from the database is stored in x.Data and will return as-is.

Note: This also means any changes in ReadResponse proto needs to make sure that we add that here and similarly the openAPI specs needs to be specified Data as object instead of bytes.

func (*ReadResponse) ProtoMessage

func (*ReadResponse) ProtoMessage()

func (*ReadResponse) ProtoReflect

func (x *ReadResponse) ProtoReflect() protoreflect.Message

func (*ReadResponse) Reset

func (x *ReadResponse) Reset()

func (*ReadResponse) String

func (x *ReadResponse) String() string

type ReplaceRequest

type ReplaceRequest struct {

	// Database name where to replace documents.
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// Collection name where to replace documents.
	Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"`
	// Array of documents to be replaced. Each document is a JSON object.
	Documents [][]byte               `protobuf:"bytes,3,rep,name=documents,proto3" json:"documents,omitempty"`
	Options   *ReplaceRequestOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*ReplaceRequest) Descriptor deprecated

func (*ReplaceRequest) Descriptor() ([]byte, []int)

Deprecated: Use ReplaceRequest.ProtoReflect.Descriptor instead.

func (*ReplaceRequest) GetCollection

func (x *ReplaceRequest) GetCollection() string

func (*ReplaceRequest) GetDb

func (x *ReplaceRequest) GetDb() string

func (*ReplaceRequest) GetDocuments

func (x *ReplaceRequest) GetDocuments() [][]byte

func (*ReplaceRequest) GetOptions

func (x *ReplaceRequest) GetOptions() *ReplaceRequestOptions

func (*ReplaceRequest) ProtoMessage

func (*ReplaceRequest) ProtoMessage()

func (*ReplaceRequest) ProtoReflect

func (x *ReplaceRequest) ProtoReflect() protoreflect.Message

func (*ReplaceRequest) Reset

func (x *ReplaceRequest) Reset()

func (*ReplaceRequest) String

func (x *ReplaceRequest) String() string

func (*ReplaceRequest) UnmarshalJSON

func (x *ReplaceRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON on ReplaceRequest avoids unmarshalling user document. We only need to extract primary/index keys from the document and want to store the document as-is in the database. This way there is no extra cost of serialization/deserialization and also less error-prone because we are not touching the user document. The req handler needs to extract out the relevant keys from the user docs and should pass it as-is to the underlying engine.

type ReplaceRequestOptions

type ReplaceRequestOptions struct {
	WriteOptions *WriteOptions `protobuf:"bytes,1,opt,name=write_options,json=writeOptions,proto3" json:"write_options,omitempty"`
	// contains filtered or unexported fields
}

Additional options for replace requests.

func (*ReplaceRequestOptions) Descriptor deprecated

func (*ReplaceRequestOptions) Descriptor() ([]byte, []int)

Deprecated: Use ReplaceRequestOptions.ProtoReflect.Descriptor instead.

func (*ReplaceRequestOptions) GetWriteOptions

func (x *ReplaceRequestOptions) GetWriteOptions() *WriteOptions

func (*ReplaceRequestOptions) ProtoMessage

func (*ReplaceRequestOptions) ProtoMessage()

func (*ReplaceRequestOptions) ProtoReflect

func (x *ReplaceRequestOptions) ProtoReflect() protoreflect.Message

func (*ReplaceRequestOptions) Reset

func (x *ReplaceRequestOptions) Reset()

func (*ReplaceRequestOptions) String

func (x *ReplaceRequestOptions) String() string

type ReplaceResponse

type ReplaceResponse struct {

	// Has metadata related to the documents stored.
	Metadata *ResponseMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// an enum with value set as "replaced"
	Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*ReplaceResponse) Descriptor deprecated

func (*ReplaceResponse) Descriptor() ([]byte, []int)

Deprecated: Use ReplaceResponse.ProtoReflect.Descriptor instead.

func (*ReplaceResponse) GetMetadata

func (x *ReplaceResponse) GetMetadata() *ResponseMetadata

func (*ReplaceResponse) GetStatus

func (x *ReplaceResponse) GetStatus() string

func (*ReplaceResponse) ProtoMessage

func (*ReplaceResponse) ProtoMessage()

func (*ReplaceResponse) ProtoReflect

func (x *ReplaceResponse) ProtoReflect() protoreflect.Message

func (*ReplaceResponse) Reset

func (x *ReplaceResponse) Reset()

func (*ReplaceResponse) String

func (x *ReplaceResponse) String() string

type ResponseMetadata

type ResponseMetadata struct {

	// Time at which the document was inserted/replaced. Measured in nano-seconds since the Unix epoch.
	CreatedAt *timestamp.Timestamp `protobuf:"bytes,1,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// Time at which the document was updated. Measured in nano-seconds since the Unix epoch.
	UpdatedAt *timestamp.Timestamp `protobuf:"bytes,2,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

Has metadata related to the documents stored.

func (*ResponseMetadata) Descriptor deprecated

func (*ResponseMetadata) Descriptor() ([]byte, []int)

Deprecated: Use ResponseMetadata.ProtoReflect.Descriptor instead.

func (*ResponseMetadata) GetCreatedAt

func (x *ResponseMetadata) GetCreatedAt() *timestamp.Timestamp

func (*ResponseMetadata) GetUpdatedAt

func (x *ResponseMetadata) GetUpdatedAt() *timestamp.Timestamp

func (*ResponseMetadata) ProtoMessage

func (*ResponseMetadata) ProtoMessage()

func (*ResponseMetadata) ProtoReflect

func (x *ResponseMetadata) ProtoReflect() protoreflect.Message

func (*ResponseMetadata) Reset

func (x *ResponseMetadata) Reset()

func (*ResponseMetadata) String

func (x *ResponseMetadata) String() string

type RollbackTransactionRequest

type RollbackTransactionRequest struct {

	// Database name this transaction belongs to.
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// Tigris transactional context with details about the transactions.
	TxCtx *TransactionCtx `protobuf:"bytes,2,opt,name=tx_ctx,json=txCtx,proto3" json:"tx_ctx,omitempty"`
	// contains filtered or unexported fields
}

Rollback transaction with the given ID

func (*RollbackTransactionRequest) Descriptor deprecated

func (*RollbackTransactionRequest) Descriptor() ([]byte, []int)

Deprecated: Use RollbackTransactionRequest.ProtoReflect.Descriptor instead.

func (*RollbackTransactionRequest) GetDb

func (*RollbackTransactionRequest) GetTxCtx

func (*RollbackTransactionRequest) ProtoMessage

func (*RollbackTransactionRequest) ProtoMessage()

func (*RollbackTransactionRequest) ProtoReflect

func (*RollbackTransactionRequest) Reset

func (x *RollbackTransactionRequest) Reset()

func (*RollbackTransactionRequest) String

func (x *RollbackTransactionRequest) String() string

type RollbackTransactionResponse

type RollbackTransactionResponse struct {

	// Status of rollback transaction operation.
	Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*RollbackTransactionResponse) Descriptor deprecated

func (*RollbackTransactionResponse) Descriptor() ([]byte, []int)

Deprecated: Use RollbackTransactionResponse.ProtoReflect.Descriptor instead.

func (*RollbackTransactionResponse) GetStatus

func (x *RollbackTransactionResponse) GetStatus() string

func (*RollbackTransactionResponse) ProtoMessage

func (*RollbackTransactionResponse) ProtoMessage()

func (*RollbackTransactionResponse) ProtoReflect

func (*RollbackTransactionResponse) Reset

func (x *RollbackTransactionResponse) Reset()

func (*RollbackTransactionResponse) String

func (x *RollbackTransactionResponse) String() string

type StreamChange

type StreamChange struct {
	CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"`
	Data           []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamChange) Descriptor deprecated

func (*StreamChange) Descriptor() ([]byte, []int)

Deprecated: Use StreamChange.ProtoReflect.Descriptor instead.

func (*StreamChange) GetCollectionName

func (x *StreamChange) GetCollectionName() string

func (*StreamChange) GetData

func (x *StreamChange) GetData() []byte

func (*StreamChange) ProtoMessage

func (*StreamChange) ProtoMessage()

func (*StreamChange) ProtoReflect

func (x *StreamChange) ProtoReflect() protoreflect.Message

func (*StreamChange) Reset

func (x *StreamChange) Reset()

func (*StreamChange) String

func (x *StreamChange) String() string

type StreamRequest

type StreamRequest struct {
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamRequest) Descriptor deprecated

func (*StreamRequest) Descriptor() ([]byte, []int)

Deprecated: Use StreamRequest.ProtoReflect.Descriptor instead.

func (*StreamRequest) GetDb

func (x *StreamRequest) GetDb() string

func (*StreamRequest) ProtoMessage

func (*StreamRequest) ProtoMessage()

func (*StreamRequest) ProtoReflect

func (x *StreamRequest) ProtoReflect() protoreflect.Message

func (*StreamRequest) Reset

func (x *StreamRequest) Reset()

func (*StreamRequest) String

func (x *StreamRequest) String() string

type StreamResponse

type StreamResponse struct {
	Changes []*StreamChange `protobuf:"bytes,1,rep,name=changes,proto3" json:"changes,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamResponse) Descriptor deprecated

func (*StreamResponse) Descriptor() ([]byte, []int)

Deprecated: Use StreamResponse.ProtoReflect.Descriptor instead.

func (*StreamResponse) GetChanges

func (x *StreamResponse) GetChanges() []*StreamChange

func (*StreamResponse) ProtoMessage

func (*StreamResponse) ProtoMessage()

func (*StreamResponse) ProtoReflect

func (x *StreamResponse) ProtoReflect() protoreflect.Message

func (*StreamResponse) Reset

func (x *StreamResponse) Reset()

func (*StreamResponse) String

func (x *StreamResponse) String() string

type TigrisClient

type TigrisClient interface {
	// Starts a new transaction and returns a transactional object. All reads/writes performed
	// within a transaction will run with serializable isolation.
	BeginTransaction(ctx context.Context, in *BeginTransactionRequest, opts ...grpc.CallOption) (*BeginTransactionResponse, error)
	// Atomically commit all the changes performed in the context of the transaction. Commit provides all
	// or nothing semantics by ensuring no partial updates are in the database due to a transaction failure.
	CommitTransaction(ctx context.Context, in *CommitTransactionRequest, opts ...grpc.CallOption) (*CommitTransactionResponse, error)
	// Rollback transaction discards all the changes
	// performed in the transaction
	RollbackTransaction(ctx context.Context, in *RollbackTransactionRequest, opts ...grpc.CallOption) (*RollbackTransactionResponse, error)
	// Inserts new documents in the collection and returns an AlreadyExists error if any of the documents
	// in the request already exists. Insert provides idempotency by returning an error if the document
	// already exists. To replace documents, use REPLACE API instead of INSERT.
	Insert(ctx context.Context, in *InsertRequest, opts ...grpc.CallOption) (*InsertResponse, error)
	// Inserts the documents or replaces the existing documents in the collections.
	Replace(ctx context.Context, in *ReplaceRequest, opts ...grpc.CallOption) (*ReplaceResponse, error)
	// Delete a range of documents in the collection using the condition provided in the filter.
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
	// Update a range of documents in the collection using the condition provided in the filter.
	Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)
	//  Reads range of documents from the collection using the condition in the filter.
	Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (Tigris_ReadClient, error)
	// Creates a new collection or atomically upgrades the collection to the new schema changes in the database
	// passed in the request.
	CreateOrUpdateCollection(ctx context.Context, in *CreateOrUpdateCollectionRequest, opts ...grpc.CallOption) (*CreateOrUpdateCollectionResponse, error)
	// Drop the collection and all its documents in the database passed in the request.
	DropCollection(ctx context.Context, in *DropCollectionRequest, opts ...grpc.CallOption) (*DropCollectionResponse, error)
	// List returns all the databases.
	ListDatabases(ctx context.Context, in *ListDatabasesRequest, opts ...grpc.CallOption) (*ListDatabasesResponse, error)
	// List all collections in the database passed in the request.
	ListCollections(ctx context.Context, in *ListCollectionsRequest, opts ...grpc.CallOption) (*ListCollectionsResponse, error)
	// Creates a new database and returns a AlreadyExists error if the database already exists.
	CreateDatabase(ctx context.Context, in *CreateDatabaseRequest, opts ...grpc.CallOption) (*CreateDatabaseResponse, error)
	// Drop database deletes all the collections in the database along with all it documents.
	DropDatabase(ctx context.Context, in *DropDatabaseRequest, opts ...grpc.CallOption) (*DropDatabaseResponse, error)
	// Describe database describes the information related to database along
	// with all the collections inside database.
	DescribeDatabase(ctx context.Context, in *DescribeDatabaseRequest, opts ...grpc.CallOption) (*DescribeDatabaseResponse, error)
	// Describe collection describes the information related to collection.
	DescribeCollection(ctx context.Context, in *DescribeCollectionRequest, opts ...grpc.CallOption) (*DescribeCollectionResponse, error)
	Stream(ctx context.Context, in *StreamRequest, opts ...grpc.CallOption) (Tigris_StreamClient, error)
}

TigrisClient is the client API for Tigris service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewTigrisClient

func NewTigrisClient(cc grpc.ClientConnInterface) TigrisClient

type TigrisError

type TigrisError struct {
	// The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. We don't need to marshal
	// this code for HTTP clients.
	Code codes.Code `json:"code,omitempty"`
	// A developer-facing error message.
	Message string `json:"message,omitempty"`
	// A list of messages that carry the error details. This is mainly to send our internal codes and messages.
	Details []*ErrorDetails `json:"details,omitempty"`
}

TigrisError is our Tigris HTTP counterpart of grpc status. All the APIs should use this Error to return as a user facing error. TigrisError will return grpcStatus to the muxer so that grpc client can see grpcStatus as the final output. For HTTP clients see the **MarshalStatus** method where we are returning the response by not the grpc code as that is not needed for HTTP clients.

func Error

func Error(c codes.Code, msg string) *TigrisError

Error returns an error representing c and msg. If c is OK, returns nil.

func Errorf

func Errorf(c codes.Code, format string, a ...interface{}) *TigrisError

Errorf returns Error(c, fmt.Sprintf(format, a...)).

func (*TigrisError) Error

func (e *TigrisError) Error() string

Error to return the underlying error message

func (*TigrisError) GRPCStatus

func (e *TigrisError) GRPCStatus() *status.Status

GRPCStatus converts the TigrisError and return status.Status. This is used to return grpc status to the grpc clients

func (*TigrisError) WithDetails

func (e *TigrisError) WithDetails(details ...*ErrorDetails) *TigrisError

WithDetails a helper method for adding details to the TigrisError

type TigrisServer

type TigrisServer interface {
	// Starts a new transaction and returns a transactional object. All reads/writes performed
	// within a transaction will run with serializable isolation.
	BeginTransaction(context.Context, *BeginTransactionRequest) (*BeginTransactionResponse, error)
	// Atomically commit all the changes performed in the context of the transaction. Commit provides all
	// or nothing semantics by ensuring no partial updates are in the database due to a transaction failure.
	CommitTransaction(context.Context, *CommitTransactionRequest) (*CommitTransactionResponse, error)
	// Rollback transaction discards all the changes
	// performed in the transaction
	RollbackTransaction(context.Context, *RollbackTransactionRequest) (*RollbackTransactionResponse, error)
	// Inserts new documents in the collection and returns an AlreadyExists error if any of the documents
	// in the request already exists. Insert provides idempotency by returning an error if the document
	// already exists. To replace documents, use REPLACE API instead of INSERT.
	Insert(context.Context, *InsertRequest) (*InsertResponse, error)
	// Inserts the documents or replaces the existing documents in the collections.
	Replace(context.Context, *ReplaceRequest) (*ReplaceResponse, error)
	// Delete a range of documents in the collection using the condition provided in the filter.
	Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
	// Update a range of documents in the collection using the condition provided in the filter.
	Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
	//  Reads range of documents from the collection using the condition in the filter.
	Read(*ReadRequest, Tigris_ReadServer) error
	// Creates a new collection or atomically upgrades the collection to the new schema changes in the database
	// passed in the request.
	CreateOrUpdateCollection(context.Context, *CreateOrUpdateCollectionRequest) (*CreateOrUpdateCollectionResponse, error)
	// Drop the collection and all its documents in the database passed in the request.
	DropCollection(context.Context, *DropCollectionRequest) (*DropCollectionResponse, error)
	// List returns all the databases.
	ListDatabases(context.Context, *ListDatabasesRequest) (*ListDatabasesResponse, error)
	// List all collections in the database passed in the request.
	ListCollections(context.Context, *ListCollectionsRequest) (*ListCollectionsResponse, error)
	// Creates a new database and returns a AlreadyExists error if the database already exists.
	CreateDatabase(context.Context, *CreateDatabaseRequest) (*CreateDatabaseResponse, error)
	// Drop database deletes all the collections in the database along with all it documents.
	DropDatabase(context.Context, *DropDatabaseRequest) (*DropDatabaseResponse, error)
	// Describe database describes the information related to database along
	// with all the collections inside database.
	DescribeDatabase(context.Context, *DescribeDatabaseRequest) (*DescribeDatabaseResponse, error)
	// Describe collection describes the information related to collection.
	DescribeCollection(context.Context, *DescribeCollectionRequest) (*DescribeCollectionResponse, error)
	Stream(*StreamRequest, Tigris_StreamServer) error
}

TigrisServer is the server API for Tigris service. All implementations should embed UnimplementedTigrisServer for forward compatibility

type Tigris_ReadClient

type Tigris_ReadClient interface {
	Recv() (*ReadResponse, error)
	grpc.ClientStream
}

type Tigris_ReadServer

type Tigris_ReadServer interface {
	Send(*ReadResponse) error
	grpc.ServerStream
}

type Tigris_StreamClient

type Tigris_StreamClient interface {
	Recv() (*StreamResponse, error)
	grpc.ClientStream
}

type Tigris_StreamServer

type Tigris_StreamServer interface {
	Send(*StreamResponse) error
	grpc.ServerStream
}

type TransactionCtx

type TransactionCtx struct {

	// Unique for a single transactional request.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Serves as an internal identifier.
	Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"`
	// contains filtered or unexported fields
}

Contains ID which uniquely identifies transaction This context is returned by BeginTransaction request and should be passed in the subsequent requests in order to run them in the context of the same transaction.

func (*TransactionCtx) Descriptor deprecated

func (*TransactionCtx) Descriptor() ([]byte, []int)

Deprecated: Use TransactionCtx.ProtoReflect.Descriptor instead.

func (*TransactionCtx) GetId

func (x *TransactionCtx) GetId() string

func (*TransactionCtx) GetOrigin

func (x *TransactionCtx) GetOrigin() string

func (*TransactionCtx) ProtoMessage

func (*TransactionCtx) ProtoMessage()

func (*TransactionCtx) ProtoReflect

func (x *TransactionCtx) ProtoReflect() protoreflect.Message

func (*TransactionCtx) Reset

func (x *TransactionCtx) Reset()

func (*TransactionCtx) String

func (x *TransactionCtx) String() string

type TransactionOptions

type TransactionOptions struct {
	// contains filtered or unexported fields
}

Options that can be used to modify the transaction semantics.

func (*TransactionOptions) Descriptor deprecated

func (*TransactionOptions) Descriptor() ([]byte, []int)

Deprecated: Use TransactionOptions.ProtoReflect.Descriptor instead.

func (*TransactionOptions) ProtoMessage

func (*TransactionOptions) ProtoMessage()

func (*TransactionOptions) ProtoReflect

func (x *TransactionOptions) ProtoReflect() protoreflect.Message

func (*TransactionOptions) Reset

func (x *TransactionOptions) Reset()

func (*TransactionOptions) String

func (x *TransactionOptions) String() string

type UnimplementedHealthAPIServer

type UnimplementedHealthAPIServer struct {
}

UnimplementedHealthAPIServer should be embedded to have forward compatible implementations.

func (UnimplementedHealthAPIServer) Health

type UnimplementedTigrisServer

type UnimplementedTigrisServer struct {
}

UnimplementedTigrisServer should be embedded to have forward compatible implementations.

func (UnimplementedTigrisServer) BeginTransaction

func (UnimplementedTigrisServer) CreateDatabase

func (UnimplementedTigrisServer) Delete

func (UnimplementedTigrisServer) DescribeDatabase

func (UnimplementedTigrisServer) DropCollection

func (UnimplementedTigrisServer) DropDatabase

func (UnimplementedTigrisServer) Insert

func (UnimplementedTigrisServer) ListCollections

func (UnimplementedTigrisServer) ListDatabases

func (UnimplementedTigrisServer) Read

func (UnimplementedTigrisServer) Replace

func (UnimplementedTigrisServer) Stream

func (UnimplementedTigrisServer) Update

type UnsafeHealthAPIServer

type UnsafeHealthAPIServer interface {
	// contains filtered or unexported methods
}

UnsafeHealthAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HealthAPIServer will result in compilation errors.

type UnsafeTigrisServer

type UnsafeTigrisServer interface {
	// contains filtered or unexported methods
}

UnsafeTigrisServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TigrisServer will result in compilation errors.

type UpdateRequest

type UpdateRequest struct {

	// Database name where to update documents
	Db string `protobuf:"bytes,1,opt,name=db,proto3" json:"db,omitempty"`
	// Collection name where to update documents
	Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"`
	// Fields contains set of fields
	// with the values which need to be updated.
	// Should be proper JSON object.
	Fields []byte `protobuf:"bytes,3,opt,name=fields,proto3" json:"fields,omitempty"`
	// Update documents which matching specified filter.
	// A filter can simply be key, value where key
	// is the field name and value would be the value for this field. Or a filter can be logical where
	// two or more fields can be logically joined using $or and $and. A few examples of filter:
	// <li> To update a user document where the id has a value 1: “`{"id": 1 }“`
	// <li> To update all the user documents where the key "id" has a value 1 or 2 or 3: `{"$or": [{"id": 1}, {"id": 2}, {"id": 3}]}`
	Filter  []byte                `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
	Options *UpdateRequestOptions `protobuf:"bytes,5,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateRequest) Descriptor deprecated

func (*UpdateRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.

func (*UpdateRequest) GetCollection

func (x *UpdateRequest) GetCollection() string

func (*UpdateRequest) GetDb

func (x *UpdateRequest) GetDb() string

func (*UpdateRequest) GetFields

func (x *UpdateRequest) GetFields() []byte

func (*UpdateRequest) GetFilter

func (x *UpdateRequest) GetFilter() []byte

func (*UpdateRequest) GetOptions

func (x *UpdateRequest) GetOptions() *UpdateRequestOptions

func (*UpdateRequest) ProtoMessage

func (*UpdateRequest) ProtoMessage()

func (*UpdateRequest) ProtoReflect

func (x *UpdateRequest) ProtoReflect() protoreflect.Message

func (*UpdateRequest) Reset

func (x *UpdateRequest) Reset()

func (*UpdateRequest) String

func (x *UpdateRequest) String() string

func (*UpdateRequest) UnmarshalJSON

func (x *UpdateRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON on UpdateRequest avoids unmarshalling filter and instead this way we can write a custom struct to do the unmarshalling and will be avoiding any extra allocation/copying.

type UpdateRequestOptions

type UpdateRequestOptions struct {
	WriteOptions *WriteOptions `protobuf:"bytes,1,opt,name=write_options,json=writeOptions,proto3" json:"write_options,omitempty"`
	// contains filtered or unexported fields
}

Additional options for update requests.

func (*UpdateRequestOptions) Descriptor deprecated

func (*UpdateRequestOptions) Descriptor() ([]byte, []int)

Deprecated: Use UpdateRequestOptions.ProtoReflect.Descriptor instead.

func (*UpdateRequestOptions) GetWriteOptions

func (x *UpdateRequestOptions) GetWriteOptions() *WriteOptions

func (*UpdateRequestOptions) ProtoMessage

func (*UpdateRequestOptions) ProtoMessage()

func (*UpdateRequestOptions) ProtoReflect

func (x *UpdateRequestOptions) ProtoReflect() protoreflect.Message

func (*UpdateRequestOptions) Reset

func (x *UpdateRequestOptions) Reset()

func (*UpdateRequestOptions) String

func (x *UpdateRequestOptions) String() string

type UpdateResponse

type UpdateResponse struct {

	// Has metadata related to the documents stored.
	Metadata *ResponseMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// Returns the number of documents modified.
	ModifiedCount int32 `protobuf:"varint,2,opt,name=modified_count,json=modifiedCount,proto3" json:"modified_count,omitempty"`
	// an enum with value set as "updated".
	Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateResponse) Descriptor deprecated

func (*UpdateResponse) Descriptor() ([]byte, []int)

Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead.

func (*UpdateResponse) GetMetadata

func (x *UpdateResponse) GetMetadata() *ResponseMetadata

func (*UpdateResponse) GetModifiedCount

func (x *UpdateResponse) GetModifiedCount() int32

func (*UpdateResponse) GetStatus

func (x *UpdateResponse) GetStatus() string

func (*UpdateResponse) ProtoMessage

func (*UpdateResponse) ProtoMessage()

func (*UpdateResponse) ProtoReflect

func (x *UpdateResponse) ProtoReflect() protoreflect.Message

func (*UpdateResponse) Reset

func (x *UpdateResponse) Reset()

func (*UpdateResponse) String

func (x *UpdateResponse) String() string

type WriteOptions

type WriteOptions struct {

	// Perform operation in the context of this transaction.
	TxCtx *TransactionCtx `protobuf:"bytes,1,opt,name=tx_ctx,json=txCtx,proto3" json:"tx_ctx,omitempty"`
	// contains filtered or unexported fields
}

Additional options to modify write requests.

func (*WriteOptions) Descriptor deprecated

func (*WriteOptions) Descriptor() ([]byte, []int)

Deprecated: Use WriteOptions.ProtoReflect.Descriptor instead.

func (*WriteOptions) GetTxCtx

func (x *WriteOptions) GetTxCtx() *TransactionCtx

func (*WriteOptions) ProtoMessage

func (*WriteOptions) ProtoMessage()

func (*WriteOptions) ProtoReflect

func (x *WriteOptions) ProtoReflect() protoreflect.Message

func (*WriteOptions) Reset

func (x *WriteOptions) Reset()

func (*WriteOptions) String

func (x *WriteOptions) String() string

Jump to

Keyboard shortcuts

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