v1

package
v0.1.313 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Status_name = map[int32]string{
		0: "UNSPECIFIED",
		1: "FAIL",
		2: "OK",
	}
	Status_value = map[string]int32{
		"UNSPECIFIED": 0,
		"FAIL":        1,
		"OK":          2,
	}
)

Enum value maps for Status.

View Source
var File_app_model_v1_model_proto protoreflect.FileDescriptor
View Source
var ModelService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "viam.app.model.v1.ModelService",
	HandlerType: (*ModelServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Delete",
			Handler:    _ModelService_Delete_Handler,
		},
		{
			MethodName: "Deploy",
			Handler:    _ModelService_Deploy_Handler,
		},
		{
			MethodName: "Info",
			Handler:    _ModelService_Info_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Upload",
			Handler:       _ModelService_Upload_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "app/model/v1/model.proto",
}

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

Functions

func RegisterModelServiceHandler

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

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

func RegisterModelServiceHandlerClient

func RegisterModelServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ModelServiceClient) error

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

func RegisterModelServiceHandlerFromEndpoint

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

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

func RegisterModelServiceHandlerServer

func RegisterModelServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ModelServiceServer) error

RegisterModelServiceHandlerServer registers the http handlers for service ModelService to "mux". UnaryRPC :call ModelServiceServer 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 RegisterModelServiceHandlerFromEndpoint instead.

func RegisterModelServiceServer

func RegisterModelServiceServer(s grpc.ServiceRegistrar, srv ModelServiceServer)

Types

type DeleteRequest

type DeleteRequest struct {
	OrgId     string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"`
	ModelName string `protobuf:"bytes,2,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteRequest) Descriptor deprecated

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetModelName added in v0.1.6

func (x *DeleteRequest) GetModelName() string

func (*DeleteRequest) GetOrgId added in v0.1.6

func (x *DeleteRequest) GetOrgId() string

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

type DeleteResponse

type DeleteResponse struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	Status  Status `protobuf:"varint,2,opt,name=status,proto3,enum=viam.app.model.v1.Status" 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) GetMessage

func (x *DeleteResponse) GetMessage() string

func (*DeleteResponse) GetStatus

func (x *DeleteResponse) GetStatus() Status

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 DeployRequest

type DeployRequest struct {
	OrgId     string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"`
	ModelName string `protobuf:"bytes,2,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
	// contains filtered or unexported fields
}

func (*DeployRequest) Descriptor deprecated

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

Deprecated: Use DeployRequest.ProtoReflect.Descriptor instead.

func (*DeployRequest) GetModelName added in v0.1.6

func (x *DeployRequest) GetModelName() string

func (*DeployRequest) GetOrgId added in v0.1.6

func (x *DeployRequest) GetOrgId() string

func (*DeployRequest) ProtoMessage

func (*DeployRequest) ProtoMessage()

func (*DeployRequest) ProtoReflect

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

func (*DeployRequest) Reset

func (x *DeployRequest) Reset()

func (*DeployRequest) String

func (x *DeployRequest) String() string

type DeployResponse

type DeployResponse struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	Status  Status `protobuf:"varint,2,opt,name=status,proto3,enum=viam.app.model.v1.Status" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*DeployResponse) Descriptor deprecated

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

Deprecated: Use DeployResponse.ProtoReflect.Descriptor instead.

func (*DeployResponse) GetMessage

func (x *DeployResponse) GetMessage() string

func (*DeployResponse) GetStatus

func (x *DeployResponse) GetStatus() Status

func (*DeployResponse) ProtoMessage

func (*DeployResponse) ProtoMessage()

func (*DeployResponse) ProtoReflect

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

func (*DeployResponse) Reset

func (x *DeployResponse) Reset()

func (*DeployResponse) String

func (x *DeployResponse) String() string

type File added in v0.1.6

type File struct {
	Name      string `protobuf:"bytes,1,opt,name=name,proto3" json:"name" bson:"name"`
	SizeBytes int64  `protobuf:"varint,2,opt,name=size_bytes,json=sizeBytes,proto3" json:"size_bytes" bson:"size_bytes"`
	// contains filtered or unexported fields
}

func (*File) Descriptor deprecated added in v0.1.6

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

Deprecated: Use File.ProtoReflect.Descriptor instead.

func (*File) GetName added in v0.1.6

func (x *File) GetName() string

func (*File) GetSizeBytes added in v0.1.6

func (x *File) GetSizeBytes() int64

func (*File) ProtoMessage added in v0.1.6

func (*File) ProtoMessage()

func (*File) ProtoReflect added in v0.1.6

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

func (*File) Reset added in v0.1.6

func (x *File) Reset()

func (*File) String added in v0.1.6

func (x *File) String() string

type FileData

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

func (*FileData) Descriptor deprecated

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

Deprecated: Use FileData.ProtoReflect.Descriptor instead.

func (*FileData) GetData

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

func (*FileData) ProtoMessage

func (*FileData) ProtoMessage()

func (*FileData) ProtoReflect

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

func (*FileData) Reset

func (x *FileData) Reset()

func (*FileData) String

func (x *FileData) String() string

type InfoRequest added in v0.1.6

type InfoRequest struct {
	OrgId string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"`
	// contains filtered or unexported fields
}

func (*InfoRequest) Descriptor deprecated added in v0.1.6

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

Deprecated: Use InfoRequest.ProtoReflect.Descriptor instead.

func (*InfoRequest) GetOrgId added in v0.1.6

func (x *InfoRequest) GetOrgId() string

func (*InfoRequest) ProtoMessage added in v0.1.6

func (*InfoRequest) ProtoMessage()

func (*InfoRequest) ProtoReflect added in v0.1.6

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

func (*InfoRequest) Reset added in v0.1.6

func (x *InfoRequest) Reset()

func (*InfoRequest) String added in v0.1.6

func (x *InfoRequest) String() string

type InfoResponse added in v0.1.6

type InfoResponse struct {
	Model []*Model `protobuf:"bytes,1,rep,name=model,proto3" json:"model,omitempty"`
	// contains filtered or unexported fields
}

func (*InfoResponse) Descriptor deprecated added in v0.1.6

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

Deprecated: Use InfoResponse.ProtoReflect.Descriptor instead.

func (*InfoResponse) GetModel added in v0.1.6

func (x *InfoResponse) GetModel() []*Model

func (*InfoResponse) ProtoMessage added in v0.1.6

func (*InfoResponse) ProtoMessage()

func (*InfoResponse) ProtoReflect added in v0.1.6

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

func (*InfoResponse) Reset added in v0.1.6

func (x *InfoResponse) Reset()

func (*InfoResponse) String added in v0.1.6

func (x *InfoResponse) String() string

type Model added in v0.1.6

type Model struct {
	Name        string                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	SizeBytes   int64                  `protobuf:"varint,2,opt,name=size_bytes,json=sizeBytes,proto3" json:"size_bytes,omitempty"`
	Files       []*File                `protobuf:"bytes,3,rep,name=files,proto3" json:"files,omitempty"`
	TimeCreated *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=time_created,json=timeCreated,proto3" json:"time_created,omitempty"`
	// contains filtered or unexported fields
}

func (*Model) Descriptor deprecated added in v0.1.6

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

Deprecated: Use Model.ProtoReflect.Descriptor instead.

func (*Model) GetFiles added in v0.1.6

func (x *Model) GetFiles() []*File

func (*Model) GetName added in v0.1.6

func (x *Model) GetName() string

func (*Model) GetSizeBytes added in v0.1.6

func (x *Model) GetSizeBytes() int64

func (*Model) GetTimeCreated added in v0.1.6

func (x *Model) GetTimeCreated() *timestamppb.Timestamp

func (*Model) ProtoMessage added in v0.1.6

func (*Model) ProtoMessage()

func (*Model) ProtoReflect added in v0.1.6

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

func (*Model) Reset added in v0.1.6

func (x *Model) Reset()

func (*Model) String added in v0.1.6

func (x *Model) String() string

type ModelServiceClient

type ModelServiceClient interface {
	Upload(ctx context.Context, opts ...grpc.CallOption) (ModelService_UploadClient, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
	Deploy(ctx context.Context, in *DeployRequest, opts ...grpc.CallOption) (*DeployResponse, error)
	Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error)
}

ModelServiceClient is the client API for ModelService 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.

type ModelServiceServer

type ModelServiceServer interface {
	Upload(ModelService_UploadServer) error
	Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
	Deploy(context.Context, *DeployRequest) (*DeployResponse, error)
	Info(context.Context, *InfoRequest) (*InfoResponse, error)
	// contains filtered or unexported methods
}

ModelServiceServer is the server API for ModelService service. All implementations must embed UnimplementedModelServiceServer for forward compatibility

type ModelService_UploadClient

type ModelService_UploadClient interface {
	Send(*UploadRequest) error
	CloseAndRecv() (*UploadResponse, error)
	grpc.ClientStream
}

type ModelService_UploadServer

type ModelService_UploadServer interface {
	SendAndClose(*UploadResponse) error
	Recv() (*UploadRequest, error)
	grpc.ServerStream
}

type Status

type Status int32
const (
	// buf:lint:ignore ENUM_VALUE_PREFIX
	// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
	Status_UNSPECIFIED Status = 0
	// buf:lint:ignore ENUM_VALUE_PREFIX
	Status_FAIL Status = 1
	// buf:lint:ignore ENUM_VALUE_PREFIX
	Status_OK Status = 2
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

func (Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use Status.Descriptor instead.

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

func (Status) Type

func (Status) Type() protoreflect.EnumType

type SyncedModel

type SyncedModel struct {
	OrgId             string                 `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id" bson:"org_id"`
	ModelName         string                 `protobuf:"bytes,2,opt,name=model_name,json=modelName,proto3" json:"model_name" bson:"model_name"`
	AssociatedDataset string                 `` /* 128-byte string literal not displayed */
	Files             []*File                `protobuf:"bytes,4,rep,name=files,proto3" json:"files" bson:"files"`
	SizeBytes         int64                  `protobuf:"varint,5,opt,name=size_bytes,json=sizeBytes,proto3" json:"size_bytes" bson:"size_bytes"`
	BlobPath          string                 `protobuf:"bytes,6,opt,name=blob_path,json=blobPath,proto3" json:"blob_path" bson:"blob_path"`
	SyncTime          *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=sync_time,json=syncTime,proto3" json:"sync_time" bson:"sync_time"`
	// contains filtered or unexported fields
}

func (*SyncedModel) Descriptor deprecated

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

Deprecated: Use SyncedModel.ProtoReflect.Descriptor instead.

func (*SyncedModel) GetAssociatedDataset

func (x *SyncedModel) GetAssociatedDataset() string

func (*SyncedModel) GetBlobPath

func (x *SyncedModel) GetBlobPath() string

func (*SyncedModel) GetFiles added in v0.1.6

func (x *SyncedModel) GetFiles() []*File

func (*SyncedModel) GetModelName

func (x *SyncedModel) GetModelName() string

func (*SyncedModel) GetOrgId

func (x *SyncedModel) GetOrgId() string

func (*SyncedModel) GetSizeBytes added in v0.1.6

func (x *SyncedModel) GetSizeBytes() int64

func (*SyncedModel) GetSyncTime

func (x *SyncedModel) GetSyncTime() *timestamppb.Timestamp

func (*SyncedModel) ProtoMessage

func (*SyncedModel) ProtoMessage()

func (*SyncedModel) ProtoReflect

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

func (*SyncedModel) Reset

func (x *SyncedModel) Reset()

func (*SyncedModel) String

func (x *SyncedModel) String() string

type UnimplementedModelServiceServer

type UnimplementedModelServiceServer struct {
}

UnimplementedModelServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedModelServiceServer) Delete

func (UnimplementedModelServiceServer) Deploy

func (UnimplementedModelServiceServer) Info added in v0.1.6

func (UnimplementedModelServiceServer) Upload

type UnsafeModelServiceServer

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

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

type UploadMetadata

type UploadMetadata struct {
	OrgId     string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"`
	ModelName string `protobuf:"bytes,2,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"`
	// TODO: Determine the format of the associated dataset. Update when it's decided
	// whether it should be by ID or name.
	AssociatedDataset string  `protobuf:"bytes,3,opt,name=associated_dataset,json=associatedDataset,proto3" json:"associated_dataset,omitempty"`
	Files             []*File `protobuf:"bytes,4,rep,name=files,proto3" json:"files,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadMetadata) Descriptor deprecated

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

Deprecated: Use UploadMetadata.ProtoReflect.Descriptor instead.

func (*UploadMetadata) GetAssociatedDataset

func (x *UploadMetadata) GetAssociatedDataset() string

func (*UploadMetadata) GetFiles added in v0.1.6

func (x *UploadMetadata) GetFiles() []*File

func (*UploadMetadata) GetModelName

func (x *UploadMetadata) GetModelName() string

func (*UploadMetadata) GetOrgId

func (x *UploadMetadata) GetOrgId() string

func (*UploadMetadata) ProtoMessage

func (*UploadMetadata) ProtoMessage()

func (*UploadMetadata) ProtoReflect

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

func (*UploadMetadata) Reset

func (x *UploadMetadata) Reset()

func (*UploadMetadata) String

func (x *UploadMetadata) String() string

type UploadRequest

type UploadRequest struct {

	// Types that are assignable to UploadPacket:
	//
	//	*UploadRequest_Metadata
	//	*UploadRequest_FileContents
	UploadPacket isUploadRequest_UploadPacket `protobuf_oneof:"upload_packet"`
	// contains filtered or unexported fields
}

func (*UploadRequest) Descriptor deprecated

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

Deprecated: Use UploadRequest.ProtoReflect.Descriptor instead.

func (*UploadRequest) GetFileContents

func (x *UploadRequest) GetFileContents() *FileData

func (*UploadRequest) GetMetadata

func (x *UploadRequest) GetMetadata() *UploadMetadata

func (*UploadRequest) GetUploadPacket

func (m *UploadRequest) GetUploadPacket() isUploadRequest_UploadPacket

func (*UploadRequest) ProtoMessage

func (*UploadRequest) ProtoMessage()

func (*UploadRequest) ProtoReflect

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

func (*UploadRequest) Reset

func (x *UploadRequest) Reset()

func (*UploadRequest) String

func (x *UploadRequest) String() string

type UploadRequest_FileContents

type UploadRequest_FileContents struct {
	FileContents *FileData `protobuf:"bytes,2,opt,name=file_contents,json=fileContents,proto3,oneof"`
}

type UploadRequest_Metadata

type UploadRequest_Metadata struct {
	Metadata *UploadMetadata `protobuf:"bytes,1,opt,name=metadata,proto3,oneof"`
}

type UploadResponse

type UploadResponse struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	Status  Status `protobuf:"varint,2,opt,name=status,proto3,enum=viam.app.model.v1.Status" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadResponse) Descriptor deprecated

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

Deprecated: Use UploadResponse.ProtoReflect.Descriptor instead.

func (*UploadResponse) GetMessage

func (x *UploadResponse) GetMessage() string

func (*UploadResponse) GetStatus

func (x *UploadResponse) GetStatus() Status

func (*UploadResponse) ProtoMessage

func (*UploadResponse) ProtoMessage()

func (*UploadResponse) ProtoReflect

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

func (*UploadResponse) Reset

func (x *UploadResponse) Reset()

func (*UploadResponse) String

func (x *UploadResponse) String() string

Jump to

Keyboard shortcuts

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