Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterModelServer(s grpc.ServiceRegistrar, srv ModelServer)
- type CreateEntityRequest
- func (*CreateEntityRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateEntityRequest) GetEntity() *proto.Entity
- func (*CreateEntityRequest) ProtoMessage()
- func (x *CreateEntityRequest) ProtoReflect() protoreflect.Message
- func (x *CreateEntityRequest) Reset()
- func (x *CreateEntityRequest) String() string
- type CreateRelationshipRequest
- func (*CreateRelationshipRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateRelationshipRequest) GetRelationship() *proto.Relationship
- func (*CreateRelationshipRequest) ProtoMessage()
- func (x *CreateRelationshipRequest) ProtoReflect() protoreflect.Message
- func (x *CreateRelationshipRequest) Reset()
- func (x *CreateRelationshipRequest) String() string
- type DeleteEntityRequest
- func (*DeleteEntityRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteEntityRequest) GetEntityId() string
- func (*DeleteEntityRequest) ProtoMessage()
- func (x *DeleteEntityRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteEntityRequest) Reset()
- func (x *DeleteEntityRequest) String() string
- type DeleteEntityResponse
- func (*DeleteEntityResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteEntityResponse) GetDeletedRelationships() []*proto.Relationship
- func (*DeleteEntityResponse) ProtoMessage()
- func (x *DeleteEntityResponse) ProtoReflect() protoreflect.Message
- func (x *DeleteEntityResponse) Reset()
- func (x *DeleteEntityResponse) String() string
- type DeleteRelationshipRequest
- func (*DeleteRelationshipRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteRelationshipRequest) GetRelationship() *proto.Relationship
- func (*DeleteRelationshipRequest) ProtoMessage()
- func (x *DeleteRelationshipRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteRelationshipRequest) Reset()
- func (x *DeleteRelationshipRequest) String() string
- type GetEntityRequest
- type ListEntitiesRequest
- func (*ListEntitiesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListEntitiesRequest) GetPageSize() int32
- func (x *ListEntitiesRequest) GetPageToken() string
- func (*ListEntitiesRequest) ProtoMessage()
- func (x *ListEntitiesRequest) ProtoReflect() protoreflect.Message
- func (x *ListEntitiesRequest) Reset()
- func (x *ListEntitiesRequest) String() string
- type ListEntitiesResponse
- func (*ListEntitiesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListEntitiesResponse) GetEntities() []*proto.Entity
- func (x *ListEntitiesResponse) GetNextPageToken() string
- func (*ListEntitiesResponse) ProtoMessage()
- func (x *ListEntitiesResponse) ProtoReflect() protoreflect.Message
- func (x *ListEntitiesResponse) Reset()
- func (x *ListEntitiesResponse) String() string
- type ListRelationshipsRequest
- func (*ListRelationshipsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListRelationshipsRequest) GetFilter() string
- func (x *ListRelationshipsRequest) GetPageSize() int32
- func (x *ListRelationshipsRequest) GetPageToken() string
- func (*ListRelationshipsRequest) ProtoMessage()
- func (x *ListRelationshipsRequest) ProtoReflect() protoreflect.Message
- func (x *ListRelationshipsRequest) Reset()
- func (x *ListRelationshipsRequest) String() string
- type ListRelationshipsResponse
- func (*ListRelationshipsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListRelationshipsResponse) GetNextPageToken() string
- func (x *ListRelationshipsResponse) GetRelationships() []*proto.Relationship
- func (*ListRelationshipsResponse) ProtoMessage()
- func (x *ListRelationshipsResponse) ProtoReflect() protoreflect.Message
- func (x *ListRelationshipsResponse) Reset()
- func (x *ListRelationshipsResponse) String() string
- type ModelClient
- type ModelServer
- type UnimplementedModelServer
- func (UnimplementedModelServer) CreateEntity(context.Context, *CreateEntityRequest) (*proto.Entity, error)
- func (UnimplementedModelServer) CreateRelationship(context.Context, *CreateRelationshipRequest) (*proto.Relationship, error)
- func (UnimplementedModelServer) DeleteEntity(context.Context, *DeleteEntityRequest) (*DeleteEntityResponse, error)
- func (UnimplementedModelServer) DeleteRelationship(context.Context, *DeleteRelationshipRequest) (*emptypb.Empty, error)
- func (UnimplementedModelServer) GetEntity(context.Context, *GetEntityRequest) (*proto.Entity, error)
- func (UnimplementedModelServer) ListEntities(context.Context, *ListEntitiesRequest) (*ListEntitiesResponse, error)
- func (UnimplementedModelServer) ListRelationships(context.Context, *ListRelationshipsRequest) (*ListRelationshipsResponse, error)
- func (UnimplementedModelServer) UpdateEntity(context.Context, *UpdateEntityRequest) (*proto.Entity, error)
- func (UnimplementedModelServer) UpsertFragment(context.Context, *UpsertFragmentRequest) (*UpsertFragmentResponse, error)
- type UnsafeModelServer
- type UpdateEntityRequest
- func (*UpdateEntityRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateEntityRequest) GetAllowMissing() bool
- func (x *UpdateEntityRequest) GetEntity() *proto.Entity
- func (x *UpdateEntityRequest) GetUpdateMask() *fieldmaskpb.FieldMask
- func (*UpdateEntityRequest) ProtoMessage()
- func (x *UpdateEntityRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateEntityRequest) Reset()
- func (x *UpdateEntityRequest) String() string
- type UpsertFragmentRequest
- func (*UpsertFragmentRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpsertFragmentRequest) GetFragment() *proto.Fragment
- func (*UpsertFragmentRequest) ProtoMessage()
- func (x *UpsertFragmentRequest) ProtoReflect() protoreflect.Message
- func (x *UpsertFragmentRequest) Reset()
- func (x *UpsertFragmentRequest) String() string
- type UpsertFragmentResponse
- func (*UpsertFragmentResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UpsertFragmentResponse) GetEntitiesCreated() int32
- func (x *UpsertFragmentResponse) GetEntitiesUpdated() int32
- func (x *UpsertFragmentResponse) GetRelationshipsCreated() int32
- func (*UpsertFragmentResponse) ProtoMessage()
- func (x *UpsertFragmentResponse) ProtoReflect() protoreflect.Message
- func (x *UpsertFragmentResponse) Reset()
- func (x *UpsertFragmentResponse) String() string
Constants ¶
const ( Model_CreateEntity_FullMethodName = "/aalyria.spacetime.api.model.v1.Model/CreateEntity" Model_UpdateEntity_FullMethodName = "/aalyria.spacetime.api.model.v1.Model/UpdateEntity" Model_DeleteEntity_FullMethodName = "/aalyria.spacetime.api.model.v1.Model/DeleteEntity" Model_CreateRelationship_FullMethodName = "/aalyria.spacetime.api.model.v1.Model/CreateRelationship" Model_DeleteRelationship_FullMethodName = "/aalyria.spacetime.api.model.v1.Model/DeleteRelationship" Model_UpsertFragment_FullMethodName = "/aalyria.spacetime.api.model.v1.Model/UpsertFragment" Model_GetEntity_FullMethodName = "/aalyria.spacetime.api.model.v1.Model/GetEntity" Model_ListEntities_FullMethodName = "/aalyria.spacetime.api.model.v1.Model/ListEntities" Model_ListRelationships_FullMethodName = "/aalyria.spacetime.api.model.v1.Model/ListRelationships" )
Variables ¶
var File_api_model_v1_model_proto protoreflect.FileDescriptor
var Model_ServiceDesc = grpc.ServiceDesc{ ServiceName: "aalyria.spacetime.api.model.v1.Model", HandlerType: (*ModelServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateEntity", Handler: _Model_CreateEntity_Handler, }, { MethodName: "UpdateEntity", Handler: _Model_UpdateEntity_Handler, }, { MethodName: "DeleteEntity", Handler: _Model_DeleteEntity_Handler, }, { MethodName: "CreateRelationship", Handler: _Model_CreateRelationship_Handler, }, { MethodName: "DeleteRelationship", Handler: _Model_DeleteRelationship_Handler, }, { MethodName: "UpsertFragment", Handler: _Model_UpsertFragment_Handler, }, { MethodName: "GetEntity", Handler: _Model_GetEntity_Handler, }, { MethodName: "ListEntities", Handler: _Model_ListEntities_Handler, }, { MethodName: "ListRelationships", Handler: _Model_ListRelationships_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/model/v1/model.proto", }
Model_ServiceDesc is the grpc.ServiceDesc for Model service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterModelServer ¶
func RegisterModelServer(s grpc.ServiceRegistrar, srv ModelServer)
Types ¶
type CreateEntityRequest ¶
type CreateEntityRequest struct {
Entity *proto.Entity `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"`
// contains filtered or unexported fields
}
func (*CreateEntityRequest) Descriptor
deprecated
func (*CreateEntityRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateEntityRequest.ProtoReflect.Descriptor instead.
func (*CreateEntityRequest) GetEntity ¶
func (x *CreateEntityRequest) GetEntity() *proto.Entity
func (*CreateEntityRequest) ProtoMessage ¶
func (*CreateEntityRequest) ProtoMessage()
func (*CreateEntityRequest) ProtoReflect ¶
func (x *CreateEntityRequest) ProtoReflect() protoreflect.Message
func (*CreateEntityRequest) Reset ¶
func (x *CreateEntityRequest) Reset()
func (*CreateEntityRequest) String ¶
func (x *CreateEntityRequest) String() string
type CreateRelationshipRequest ¶
type CreateRelationshipRequest struct {
Relationship *proto.Relationship `protobuf:"bytes,1,opt,name=relationship,proto3" json:"relationship,omitempty"`
// contains filtered or unexported fields
}
func (*CreateRelationshipRequest) Descriptor
deprecated
func (*CreateRelationshipRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateRelationshipRequest.ProtoReflect.Descriptor instead.
func (*CreateRelationshipRequest) GetRelationship ¶
func (x *CreateRelationshipRequest) GetRelationship() *proto.Relationship
func (*CreateRelationshipRequest) ProtoMessage ¶
func (*CreateRelationshipRequest) ProtoMessage()
func (*CreateRelationshipRequest) ProtoReflect ¶
func (x *CreateRelationshipRequest) ProtoReflect() protoreflect.Message
func (*CreateRelationshipRequest) Reset ¶
func (x *CreateRelationshipRequest) Reset()
func (*CreateRelationshipRequest) String ¶
func (x *CreateRelationshipRequest) String() string
type DeleteEntityRequest ¶
type DeleteEntityRequest struct {
EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"`
// contains filtered or unexported fields
}
func (*DeleteEntityRequest) Descriptor
deprecated
func (*DeleteEntityRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteEntityRequest.ProtoReflect.Descriptor instead.
func (*DeleteEntityRequest) GetEntityId ¶
func (x *DeleteEntityRequest) GetEntityId() string
func (*DeleteEntityRequest) ProtoMessage ¶
func (*DeleteEntityRequest) ProtoMessage()
func (*DeleteEntityRequest) ProtoReflect ¶
func (x *DeleteEntityRequest) ProtoReflect() protoreflect.Message
func (*DeleteEntityRequest) Reset ¶
func (x *DeleteEntityRequest) Reset()
func (*DeleteEntityRequest) String ¶
func (x *DeleteEntityRequest) String() string
type DeleteEntityResponse ¶
type DeleteEntityResponse struct {
DeletedRelationships []*proto.Relationship `protobuf:"bytes,1,rep,name=deleted_relationships,json=deletedRelationships,proto3" json:"deleted_relationships,omitempty"`
// contains filtered or unexported fields
}
func (*DeleteEntityResponse) Descriptor
deprecated
func (*DeleteEntityResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeleteEntityResponse.ProtoReflect.Descriptor instead.
func (*DeleteEntityResponse) GetDeletedRelationships ¶
func (x *DeleteEntityResponse) GetDeletedRelationships() []*proto.Relationship
func (*DeleteEntityResponse) ProtoMessage ¶
func (*DeleteEntityResponse) ProtoMessage()
func (*DeleteEntityResponse) ProtoReflect ¶
func (x *DeleteEntityResponse) ProtoReflect() protoreflect.Message
func (*DeleteEntityResponse) Reset ¶
func (x *DeleteEntityResponse) Reset()
func (*DeleteEntityResponse) String ¶
func (x *DeleteEntityResponse) String() string
type DeleteRelationshipRequest ¶
type DeleteRelationshipRequest struct {
Relationship *proto.Relationship `protobuf:"bytes,1,opt,name=relationship,proto3" json:"relationship,omitempty"`
// contains filtered or unexported fields
}
func (*DeleteRelationshipRequest) Descriptor
deprecated
func (*DeleteRelationshipRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteRelationshipRequest.ProtoReflect.Descriptor instead.
func (*DeleteRelationshipRequest) GetRelationship ¶
func (x *DeleteRelationshipRequest) GetRelationship() *proto.Relationship
func (*DeleteRelationshipRequest) ProtoMessage ¶
func (*DeleteRelationshipRequest) ProtoMessage()
func (*DeleteRelationshipRequest) ProtoReflect ¶
func (x *DeleteRelationshipRequest) ProtoReflect() protoreflect.Message
func (*DeleteRelationshipRequest) Reset ¶
func (x *DeleteRelationshipRequest) Reset()
func (*DeleteRelationshipRequest) String ¶
func (x *DeleteRelationshipRequest) String() string
type GetEntityRequest ¶
type GetEntityRequest struct {
EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"`
// contains filtered or unexported fields
}
func (*GetEntityRequest) Descriptor
deprecated
func (*GetEntityRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetEntityRequest.ProtoReflect.Descriptor instead.
func (*GetEntityRequest) GetEntityId ¶
func (x *GetEntityRequest) GetEntityId() string
func (*GetEntityRequest) ProtoMessage ¶
func (*GetEntityRequest) ProtoMessage()
func (*GetEntityRequest) ProtoReflect ¶
func (x *GetEntityRequest) ProtoReflect() protoreflect.Message
func (*GetEntityRequest) Reset ¶
func (x *GetEntityRequest) Reset()
func (*GetEntityRequest) String ¶
func (x *GetEntityRequest) String() string
type ListEntitiesRequest ¶
type ListEntitiesRequest struct {
// The maximum number of entities to return. The server may return fewer.
//
// A page size greater than the max allowed by the server is reduced to the
// server's max allowed number of items per page. A negative page size is
// rejected with INVALID_ARGUMENT rather than read as unset.
PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// Opaque, url-safe token naming where the next page begins. Empty on the
// first request; thereafter the next_page_token of the previous response.
PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// contains filtered or unexported fields
}
func (*ListEntitiesRequest) Descriptor
deprecated
func (*ListEntitiesRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListEntitiesRequest.ProtoReflect.Descriptor instead.
func (*ListEntitiesRequest) GetPageSize ¶ added in v1.0.1789456373
func (x *ListEntitiesRequest) GetPageSize() int32
func (*ListEntitiesRequest) GetPageToken ¶ added in v1.0.1789456373
func (x *ListEntitiesRequest) GetPageToken() string
func (*ListEntitiesRequest) ProtoMessage ¶
func (*ListEntitiesRequest) ProtoMessage()
func (*ListEntitiesRequest) ProtoReflect ¶
func (x *ListEntitiesRequest) ProtoReflect() protoreflect.Message
func (*ListEntitiesRequest) Reset ¶
func (x *ListEntitiesRequest) Reset()
func (*ListEntitiesRequest) String ¶
func (x *ListEntitiesRequest) String() string
type ListEntitiesResponse ¶
type ListEntitiesResponse struct {
Entities []*proto.Entity `protobuf:"bytes,1,rep,name=entities,proto3" json:"entities,omitempty"`
// Pass this as the next request's page_token to fetch the following page. If
// empty there are no more pages matching the query.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
// contains filtered or unexported fields
}
func (*ListEntitiesResponse) Descriptor
deprecated
func (*ListEntitiesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListEntitiesResponse.ProtoReflect.Descriptor instead.
func (*ListEntitiesResponse) GetEntities ¶
func (x *ListEntitiesResponse) GetEntities() []*proto.Entity
func (*ListEntitiesResponse) GetNextPageToken ¶ added in v1.0.1789456373
func (x *ListEntitiesResponse) GetNextPageToken() string
func (*ListEntitiesResponse) ProtoMessage ¶
func (*ListEntitiesResponse) ProtoMessage()
func (*ListEntitiesResponse) ProtoReflect ¶
func (x *ListEntitiesResponse) ProtoReflect() protoreflect.Message
func (*ListEntitiesResponse) Reset ¶
func (x *ListEntitiesResponse) Reset()
func (*ListEntitiesResponse) String ¶
func (x *ListEntitiesResponse) String() string
type ListRelationshipsRequest ¶
type ListRelationshipsRequest struct {
// Filter the relationships using Common Expression Language (CEL).
Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
// The maximum number of relationships to return per page in the query. The
// server may return fewer records.
//
// A page size greater than the max allowed by the server is reduced to the
// server's max allowed number of items per page. A negative page size is
// rejected with INVALID_ARGUMENT rather than read as unset.
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// Opaque, url-safe token naming where the next page begins. Empty on the
// first request; thereafter the next_page_token of the previous response.
PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// contains filtered or unexported fields
}
func (*ListRelationshipsRequest) Descriptor
deprecated
func (*ListRelationshipsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRelationshipsRequest.ProtoReflect.Descriptor instead.
func (*ListRelationshipsRequest) GetFilter ¶
func (x *ListRelationshipsRequest) GetFilter() string
func (*ListRelationshipsRequest) GetPageSize ¶ added in v1.0.1789456373
func (x *ListRelationshipsRequest) GetPageSize() int32
func (*ListRelationshipsRequest) GetPageToken ¶ added in v1.0.1789456373
func (x *ListRelationshipsRequest) GetPageToken() string
func (*ListRelationshipsRequest) ProtoMessage ¶
func (*ListRelationshipsRequest) ProtoMessage()
func (*ListRelationshipsRequest) ProtoReflect ¶
func (x *ListRelationshipsRequest) ProtoReflect() protoreflect.Message
func (*ListRelationshipsRequest) Reset ¶
func (x *ListRelationshipsRequest) Reset()
func (*ListRelationshipsRequest) String ¶
func (x *ListRelationshipsRequest) String() string
type ListRelationshipsResponse ¶
type ListRelationshipsResponse struct {
Relationships []*proto.Relationship `protobuf:"bytes,1,rep,name=relationships,proto3" json:"relationships,omitempty"`
// Pass this as the next request's page_token to fetch the following page. If
// empty there are no more pages matching the query.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
// contains filtered or unexported fields
}
func (*ListRelationshipsResponse) Descriptor
deprecated
func (*ListRelationshipsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListRelationshipsResponse.ProtoReflect.Descriptor instead.
func (*ListRelationshipsResponse) GetNextPageToken ¶ added in v1.0.1789456373
func (x *ListRelationshipsResponse) GetNextPageToken() string
func (*ListRelationshipsResponse) GetRelationships ¶
func (x *ListRelationshipsResponse) GetRelationships() []*proto.Relationship
func (*ListRelationshipsResponse) ProtoMessage ¶
func (*ListRelationshipsResponse) ProtoMessage()
func (*ListRelationshipsResponse) ProtoReflect ¶
func (x *ListRelationshipsResponse) ProtoReflect() protoreflect.Message
func (*ListRelationshipsResponse) Reset ¶
func (x *ListRelationshipsResponse) Reset()
func (*ListRelationshipsResponse) String ¶
func (x *ListRelationshipsResponse) String() string
type ModelClient ¶
type ModelClient interface {
// Create an nmts.Entity.
//
// Returns a gRPC error whenver:
// - the supplied nmts.Entity's Id is already used
// - the supplied nmts.Entity's Id is missing or ill-formed
CreateEntity(ctx context.Context, in *CreateEntityRequest, opts ...grpc.CallOption) (*proto.Entity, error)
// Change a portion of an nmts.Entity.
UpdateEntity(ctx context.Context, in *UpdateEntityRequest, opts ...grpc.CallOption) (*proto.Entity, error)
// Delete an nmts.Entity.
//
// Also deletes any nmts.Relationships in which the nmts.Entity
// participates; if so, these are listed in the DeleteEntityResponse.
//
// Returns a gRPC NotFound error if an Entity with the supplied Id
// is not in the model.
DeleteEntity(ctx context.Context, in *DeleteEntityRequest, opts ...grpc.CallOption) (*DeleteEntityResponse, error)
// Insert an nmts.Relationship.
//
// Returns a gRPC error if any of the preconditions for a valid
// Relationship are not met (see NMTS's //lib/validation).
//
// Note: If the requested relationship kind between the same two entities
// already exists, then this has no real effect. No duplicate is created.
CreateRelationship(ctx context.Context, in *CreateRelationshipRequest, opts ...grpc.CallOption) (*proto.Relationship, error)
// Delete an nmts.Relationship.
//
// Returns a gRPC NotFound error if the Relationship is not in the model.
DeleteRelationship(ctx context.Context, in *DeleteRelationshipRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// Upsert (create-or-replace) every nmts.Entity and nmts.Relationship in a
// Fragment in a single atomic transaction that is validated exactly once.
//
// Existing entities are fully replaced (an entity's kind may not change).
// A relationship that already exists (same a/kind/z) is a no-op. The whole
// fragment is applied atomically: on any validation or write error, nothing
// is committed.
UpsertFragment(ctx context.Context, in *UpsertFragmentRequest, opts ...grpc.CallOption) (*UpsertFragmentResponse, error)
// Retrieve an nmts.Entity
//
// Returns a gRPC NotFound error if an Entity with the supplied Id
// is not in the model.
GetEntity(ctx context.Context, in *GetEntityRequest, opts ...grpc.CallOption) (*proto.Entity, error)
// List the entities in the model, one page at a time.
ListEntities(ctx context.Context, in *ListEntitiesRequest, opts ...grpc.CallOption) (*ListEntitiesResponse, error)
// List the relationships in the model, one page at a time.
ListRelationships(ctx context.Context, in *ListRelationshipsRequest, opts ...grpc.CallOption) (*ListRelationshipsResponse, error)
}
ModelClient is the client API for Model 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 NewModelClient ¶
func NewModelClient(cc grpc.ClientConnInterface) ModelClient
type ModelServer ¶
type ModelServer interface {
// Create an nmts.Entity.
//
// Returns a gRPC error whenver:
// - the supplied nmts.Entity's Id is already used
// - the supplied nmts.Entity's Id is missing or ill-formed
CreateEntity(context.Context, *CreateEntityRequest) (*proto.Entity, error)
// Change a portion of an nmts.Entity.
UpdateEntity(context.Context, *UpdateEntityRequest) (*proto.Entity, error)
// Delete an nmts.Entity.
//
// Also deletes any nmts.Relationships in which the nmts.Entity
// participates; if so, these are listed in the DeleteEntityResponse.
//
// Returns a gRPC NotFound error if an Entity with the supplied Id
// is not in the model.
DeleteEntity(context.Context, *DeleteEntityRequest) (*DeleteEntityResponse, error)
// Insert an nmts.Relationship.
//
// Returns a gRPC error if any of the preconditions for a valid
// Relationship are not met (see NMTS's //lib/validation).
//
// Note: If the requested relationship kind between the same two entities
// already exists, then this has no real effect. No duplicate is created.
CreateRelationship(context.Context, *CreateRelationshipRequest) (*proto.Relationship, error)
// Delete an nmts.Relationship.
//
// Returns a gRPC NotFound error if the Relationship is not in the model.
DeleteRelationship(context.Context, *DeleteRelationshipRequest) (*emptypb.Empty, error)
// Upsert (create-or-replace) every nmts.Entity and nmts.Relationship in a
// Fragment in a single atomic transaction that is validated exactly once.
//
// Existing entities are fully replaced (an entity's kind may not change).
// A relationship that already exists (same a/kind/z) is a no-op. The whole
// fragment is applied atomically: on any validation or write error, nothing
// is committed.
UpsertFragment(context.Context, *UpsertFragmentRequest) (*UpsertFragmentResponse, error)
// Retrieve an nmts.Entity
//
// Returns a gRPC NotFound error if an Entity with the supplied Id
// is not in the model.
GetEntity(context.Context, *GetEntityRequest) (*proto.Entity, error)
// List the entities in the model, one page at a time.
ListEntities(context.Context, *ListEntitiesRequest) (*ListEntitiesResponse, error)
// List the relationships in the model, one page at a time.
ListRelationships(context.Context, *ListRelationshipsRequest) (*ListRelationshipsResponse, error)
}
ModelServer is the server API for Model service. All implementations should embed UnimplementedModelServer for forward compatibility.
type UnimplementedModelServer ¶
type UnimplementedModelServer struct{}
UnimplementedModelServer should be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedModelServer) CreateEntity ¶
func (UnimplementedModelServer) CreateEntity(context.Context, *CreateEntityRequest) (*proto.Entity, error)
func (UnimplementedModelServer) CreateRelationship ¶
func (UnimplementedModelServer) CreateRelationship(context.Context, *CreateRelationshipRequest) (*proto.Relationship, error)
func (UnimplementedModelServer) DeleteEntity ¶
func (UnimplementedModelServer) DeleteEntity(context.Context, *DeleteEntityRequest) (*DeleteEntityResponse, error)
func (UnimplementedModelServer) DeleteRelationship ¶
func (UnimplementedModelServer) DeleteRelationship(context.Context, *DeleteRelationshipRequest) (*emptypb.Empty, error)
func (UnimplementedModelServer) GetEntity ¶
func (UnimplementedModelServer) GetEntity(context.Context, *GetEntityRequest) (*proto.Entity, error)
func (UnimplementedModelServer) ListEntities ¶
func (UnimplementedModelServer) ListEntities(context.Context, *ListEntitiesRequest) (*ListEntitiesResponse, error)
func (UnimplementedModelServer) ListRelationships ¶
func (UnimplementedModelServer) ListRelationships(context.Context, *ListRelationshipsRequest) (*ListRelationshipsResponse, error)
func (UnimplementedModelServer) UpdateEntity ¶
func (UnimplementedModelServer) UpdateEntity(context.Context, *UpdateEntityRequest) (*proto.Entity, error)
func (UnimplementedModelServer) UpsertFragment ¶ added in v1.0.1783524911
func (UnimplementedModelServer) UpsertFragment(context.Context, *UpsertFragmentRequest) (*UpsertFragmentResponse, error)
type UnsafeModelServer ¶
type UnsafeModelServer interface {
// contains filtered or unexported methods
}
UnsafeModelServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ModelServer will result in compilation errors.
type UpdateEntityRequest ¶
type UpdateEntityRequest struct {
Entity *proto.Entity `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"`
// If provided, update only fields included in the update_mask.
UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
// If set to true, and the entity named above is not found, a new
// instance will be created. In this situation, `update_mask` is
// ignored.
AllowMissing bool `protobuf:"varint,3,opt,name=allow_missing,json=allowMissing,proto3" json:"allow_missing,omitempty"`
// contains filtered or unexported fields
}
func (*UpdateEntityRequest) Descriptor
deprecated
func (*UpdateEntityRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateEntityRequest.ProtoReflect.Descriptor instead.
func (*UpdateEntityRequest) GetAllowMissing ¶
func (x *UpdateEntityRequest) GetAllowMissing() bool
func (*UpdateEntityRequest) GetEntity ¶
func (x *UpdateEntityRequest) GetEntity() *proto.Entity
func (*UpdateEntityRequest) GetUpdateMask ¶
func (x *UpdateEntityRequest) GetUpdateMask() *fieldmaskpb.FieldMask
func (*UpdateEntityRequest) ProtoMessage ¶
func (*UpdateEntityRequest) ProtoMessage()
func (*UpdateEntityRequest) ProtoReflect ¶
func (x *UpdateEntityRequest) ProtoReflect() protoreflect.Message
func (*UpdateEntityRequest) Reset ¶
func (x *UpdateEntityRequest) Reset()
func (*UpdateEntityRequest) String ¶
func (x *UpdateEntityRequest) String() string
type UpsertFragmentRequest ¶ added in v1.0.1783524911
type UpsertFragmentRequest struct {
Fragment *proto.Fragment `protobuf:"bytes,1,opt,name=fragment,proto3" json:"fragment,omitempty"`
// contains filtered or unexported fields
}
func (*UpsertFragmentRequest) Descriptor
deprecated
added in
v1.0.1783524911
func (*UpsertFragmentRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpsertFragmentRequest.ProtoReflect.Descriptor instead.
func (*UpsertFragmentRequest) GetFragment ¶ added in v1.0.1783524911
func (x *UpsertFragmentRequest) GetFragment() *proto.Fragment
func (*UpsertFragmentRequest) ProtoMessage ¶ added in v1.0.1783524911
func (*UpsertFragmentRequest) ProtoMessage()
func (*UpsertFragmentRequest) ProtoReflect ¶ added in v1.0.1783524911
func (x *UpsertFragmentRequest) ProtoReflect() protoreflect.Message
func (*UpsertFragmentRequest) Reset ¶ added in v1.0.1783524911
func (x *UpsertFragmentRequest) Reset()
func (*UpsertFragmentRequest) String ¶ added in v1.0.1783524911
func (x *UpsertFragmentRequest) String() string
type UpsertFragmentResponse ¶ added in v1.0.1783524911
type UpsertFragmentResponse struct {
EntitiesCreated int32 `protobuf:"varint,1,opt,name=entities_created,json=entitiesCreated,proto3" json:"entities_created,omitempty"`
EntitiesUpdated int32 `protobuf:"varint,2,opt,name=entities_updated,json=entitiesUpdated,proto3" json:"entities_updated,omitempty"`
RelationshipsCreated int32 `protobuf:"varint,3,opt,name=relationships_created,json=relationshipsCreated,proto3" json:"relationships_created,omitempty"`
// contains filtered or unexported fields
}
func (*UpsertFragmentResponse) Descriptor
deprecated
added in
v1.0.1783524911
func (*UpsertFragmentResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpsertFragmentResponse.ProtoReflect.Descriptor instead.
func (*UpsertFragmentResponse) GetEntitiesCreated ¶ added in v1.0.1783524911
func (x *UpsertFragmentResponse) GetEntitiesCreated() int32
func (*UpsertFragmentResponse) GetEntitiesUpdated ¶ added in v1.0.1783524911
func (x *UpsertFragmentResponse) GetEntitiesUpdated() int32
func (*UpsertFragmentResponse) GetRelationshipsCreated ¶ added in v1.0.1783524911
func (x *UpsertFragmentResponse) GetRelationshipsCreated() int32
func (*UpsertFragmentResponse) ProtoMessage ¶ added in v1.0.1783524911
func (*UpsertFragmentResponse) ProtoMessage()
func (*UpsertFragmentResponse) ProtoReflect ¶ added in v1.0.1783524911
func (x *UpsertFragmentResponse) ProtoReflect() protoreflect.Message
func (*UpsertFragmentResponse) Reset ¶ added in v1.0.1783524911
func (x *UpsertFragmentResponse) Reset()
func (*UpsertFragmentResponse) String ¶ added in v1.0.1783524911
func (x *UpsertFragmentResponse) String() string
Source Files
¶
- model.pb.go
- model_grpc.pb.go