model

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 21 Imported by: 11

Documentation

Overview

Package model is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Model_GetManifest_FullMethodName    = "/aserto.directory.model.v3.Model/GetManifest"
	Model_SetManifest_FullMethodName    = "/aserto.directory.model.v3.Model/SetManifest"
	Model_DeleteManifest_FullMethodName = "/aserto.directory.model.v3.Model/DeleteManifest"
)

Variables

View Source
var File_aserto_directory_model_v3_model_proto protoreflect.FileDescriptor
View Source
var Model_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "aserto.directory.model.v3.Model",
	HandlerType: (*ModelServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "DeleteManifest",
			Handler:    _Model_DeleteManifest_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetManifest",
			Handler:       _Model_GetManifest_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "SetManifest",
			Handler:       _Model_SetManifest_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "aserto/directory/model/v3/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 RegisterModelHandler

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

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

func RegisterModelHandlerClient

func RegisterModelHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ModelClient) error

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

func RegisterModelHandlerFromEndpoint

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

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

func RegisterModelHandlerServer

func RegisterModelHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ModelServer) error

RegisterModelHandlerServer registers the http handlers for service Model to "mux". UnaryRPC :call ModelServer 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 RegisterModelHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterModelServer

func RegisterModelServer(s grpc.ServiceRegistrar, srv ModelServer)

Types

type Body

type Body struct {

	// manifest content
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Body) Descriptor deprecated

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

Deprecated: Use Body.ProtoReflect.Descriptor instead.

func (*Body) GetData

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

func (*Body) ProtoMessage

func (*Body) ProtoMessage()

func (*Body) ProtoReflect

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

func (*Body) Reset

func (x *Body) Reset()

func (*Body) String

func (x *Body) String() string

type DeleteManifestRequest

type DeleteManifestRequest struct {

	// empty request
	Empty *emptypb.Empty `protobuf:"bytes,1,opt,name=empty,proto3" json:"empty,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteManifestRequest) Descriptor deprecated

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

Deprecated: Use DeleteManifestRequest.ProtoReflect.Descriptor instead.

func (*DeleteManifestRequest) GetEmpty

func (x *DeleteManifestRequest) GetEmpty() *emptypb.Empty

func (*DeleteManifestRequest) ProtoMessage

func (*DeleteManifestRequest) ProtoMessage()

func (*DeleteManifestRequest) ProtoReflect

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

func (*DeleteManifestRequest) Reset

func (x *DeleteManifestRequest) Reset()

func (*DeleteManifestRequest) String

func (x *DeleteManifestRequest) String() string

type DeleteManifestResponse

type DeleteManifestResponse struct {

	// empty result
	Result *emptypb.Empty `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteManifestResponse) Descriptor deprecated

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

Deprecated: Use DeleteManifestResponse.ProtoReflect.Descriptor instead.

func (*DeleteManifestResponse) GetResult

func (x *DeleteManifestResponse) GetResult() *emptypb.Empty

func (*DeleteManifestResponse) ProtoMessage

func (*DeleteManifestResponse) ProtoMessage()

func (*DeleteManifestResponse) ProtoReflect

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

func (*DeleteManifestResponse) Reset

func (x *DeleteManifestResponse) Reset()

func (*DeleteManifestResponse) String

func (x *DeleteManifestResponse) String() string

type GetManifestRequest

type GetManifestRequest struct {

	// empty request
	Empty *emptypb.Empty `protobuf:"bytes,1,opt,name=empty,proto3" json:"empty,omitempty"`
	// contains filtered or unexported fields
}

func (*GetManifestRequest) Descriptor deprecated

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

Deprecated: Use GetManifestRequest.ProtoReflect.Descriptor instead.

func (*GetManifestRequest) GetEmpty

func (x *GetManifestRequest) GetEmpty() *emptypb.Empty

func (*GetManifestRequest) ProtoMessage

func (*GetManifestRequest) ProtoMessage()

func (*GetManifestRequest) ProtoReflect

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

func (*GetManifestRequest) Reset

func (x *GetManifestRequest) Reset()

func (*GetManifestRequest) String

func (x *GetManifestRequest) String() string

type GetManifestResponse

type GetManifestResponse struct {

	// Types that are assignable to Msg:
	//
	//	*GetManifestResponse_Metadata
	//	*GetManifestResponse_Body
	//	*GetManifestResponse_Model
	Msg isGetManifestResponse_Msg `protobuf_oneof:"msg"`
	// contains filtered or unexported fields
}

func (*GetManifestResponse) Descriptor deprecated

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

Deprecated: Use GetManifestResponse.ProtoReflect.Descriptor instead.

func (*GetManifestResponse) GetBody

func (x *GetManifestResponse) GetBody() *Body

func (*GetManifestResponse) GetMetadata

func (x *GetManifestResponse) GetMetadata() *Metadata

func (*GetManifestResponse) GetModel

func (x *GetManifestResponse) GetModel() *structpb.Struct

func (*GetManifestResponse) GetMsg

func (m *GetManifestResponse) GetMsg() isGetManifestResponse_Msg

func (*GetManifestResponse) ProtoMessage

func (*GetManifestResponse) ProtoMessage()

func (*GetManifestResponse) ProtoReflect

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

func (*GetManifestResponse) Reset

func (x *GetManifestResponse) Reset()

func (*GetManifestResponse) String

func (x *GetManifestResponse) String() string

type GetManifestResponse_Body

type GetManifestResponse_Body struct {
	// Manifest content
	Body *Body `protobuf:"bytes,2,opt,name=body,proto3,oneof"`
}

type GetManifestResponse_Metadata

type GetManifestResponse_Metadata struct {
	// Manifest metadata
	Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3,oneof"`
}

type GetManifestResponse_Model

type GetManifestResponse_Model struct {
	// Model
	Model *structpb.Struct `protobuf:"bytes,3,opt,name=model,proto3,oneof"`
}

type Metadata

type Metadata struct {

	// last updated timestamp (UTC)
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,21,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// object instance etag
	Etag string `protobuf:"bytes,23,opt,name=etag,proto3" json:"etag,omitempty"`
	// contains filtered or unexported fields
}

func (*Metadata) Descriptor deprecated

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

Deprecated: Use Metadata.ProtoReflect.Descriptor instead.

func (*Metadata) GetEtag

func (x *Metadata) GetEtag() string

func (*Metadata) GetUpdatedAt

func (x *Metadata) GetUpdatedAt() *timestamppb.Timestamp

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) ProtoReflect

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

func (*Metadata) Reset

func (x *Metadata) Reset()

func (*Metadata) String

func (x *Metadata) String() string

type ModelClient

type ModelClient interface {
	// get manifest instance
	GetManifest(ctx context.Context, in *GetManifestRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetManifestResponse], error)
	// set manifest instance
	SetManifest(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[SetManifestRequest, SetManifestResponse], error)
	// delete manifest instance
	DeleteManifest(ctx context.Context, in *DeleteManifestRequest, opts ...grpc.CallOption) (*DeleteManifestResponse, 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 {
	// get manifest instance
	GetManifest(*GetManifestRequest, grpc.ServerStreamingServer[GetManifestResponse]) error
	// set manifest instance
	SetManifest(grpc.ClientStreamingServer[SetManifestRequest, SetManifestResponse]) error
	// delete manifest instance
	DeleteManifest(context.Context, *DeleteManifestRequest) (*DeleteManifestResponse, error)
}

ModelServer is the server API for Model service. All implementations should embed UnimplementedModelServer for forward compatibility.

type Model_GetManifestClient

type Model_GetManifestClient = grpc.ServerStreamingClient[GetManifestResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Model_GetManifestServer

type Model_GetManifestServer = grpc.ServerStreamingServer[GetManifestResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Model_SetManifestClient

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Model_SetManifestServer

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type SetManifestRequest

type SetManifestRequest struct {

	// manifest instance
	//
	// Types that are assignable to Msg:
	//
	//	*SetManifestRequest_Body
	Msg isSetManifestRequest_Msg `protobuf_oneof:"msg"`
	// contains filtered or unexported fields
}

func (*SetManifestRequest) Descriptor deprecated

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

Deprecated: Use SetManifestRequest.ProtoReflect.Descriptor instead.

func (*SetManifestRequest) GetBody

func (x *SetManifestRequest) GetBody() *Body

func (*SetManifestRequest) GetMsg

func (m *SetManifestRequest) GetMsg() isSetManifestRequest_Msg

func (*SetManifestRequest) ProtoMessage

func (*SetManifestRequest) ProtoMessage()

func (*SetManifestRequest) ProtoReflect

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

func (*SetManifestRequest) Reset

func (x *SetManifestRequest) Reset()

func (*SetManifestRequest) String

func (x *SetManifestRequest) String() string

type SetManifestRequest_Body

type SetManifestRequest_Body struct {
	// Manifest content
	Body *Body `protobuf:"bytes,1,opt,name=body,proto3,oneof"`
}

type SetManifestResponse

type SetManifestResponse struct {

	// empty result
	Result *emptypb.Empty `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*SetManifestResponse) Descriptor deprecated

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

Deprecated: Use SetManifestResponse.ProtoReflect.Descriptor instead.

func (*SetManifestResponse) GetResult

func (x *SetManifestResponse) GetResult() *emptypb.Empty

func (*SetManifestResponse) ProtoMessage

func (*SetManifestResponse) ProtoMessage()

func (*SetManifestResponse) ProtoReflect

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

func (*SetManifestResponse) Reset

func (x *SetManifestResponse) Reset()

func (*SetManifestResponse) String

func (x *SetManifestResponse) String() string

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) DeleteManifest

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.

Jump to

Keyboard shortcuts

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