v1

package
v0.1.295 Latest Latest
Warning

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

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

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 (
	PackageType_name = map[int32]string{
		0: "PACKAGE_TYPE_UNSPECIFIED",
		1: "PACKAGE_TYPE_ARCHIVE",
		2: "PACKAGE_TYPE_ML_MODEL",
		3: "PACKAGE_TYPE_MODULE",
		4: "PACKAGE_TYPE_SLAM_MAP",
		5: "PACKAGE_TYPE_ML_TRAINING",
	}
	PackageType_value = map[string]int32{
		"PACKAGE_TYPE_UNSPECIFIED": 0,
		"PACKAGE_TYPE_ARCHIVE":     1,
		"PACKAGE_TYPE_ML_MODEL":    2,
		"PACKAGE_TYPE_MODULE":      3,
		"PACKAGE_TYPE_SLAM_MAP":    4,
		"PACKAGE_TYPE_ML_TRAINING": 5,
	}
)

Enum value maps for PackageType.

View Source
var File_app_packages_v1_packages_proto protoreflect.FileDescriptor
View Source
var PackageService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "viam.app.packages.v1.PackageService",
	HandlerType: (*PackageServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "DeletePackage",
			Handler:    _PackageService_DeletePackage_Handler,
		},
		{
			MethodName: "GetPackage",
			Handler:    _PackageService_GetPackage_Handler,
		},
		{
			MethodName: "ListPackages",
			Handler:    _PackageService_ListPackages_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "CreatePackage",
			Handler:       _PackageService_CreatePackage_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "app/packages/v1/packages.proto",
}

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

Functions

func RegisterPackageServiceHandler

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

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

func RegisterPackageServiceHandlerClient

func RegisterPackageServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PackageServiceClient) error

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

func RegisterPackageServiceHandlerFromEndpoint

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

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

func RegisterPackageServiceHandlerServer

func RegisterPackageServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PackageServiceServer) error

RegisterPackageServiceHandlerServer registers the http handlers for service PackageService to "mux". UnaryRPC :call PackageServiceServer 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 RegisterPackageServiceHandlerFromEndpoint instead.

func RegisterPackageServiceServer

func RegisterPackageServiceServer(s grpc.ServiceRegistrar, srv PackageServiceServer)

Types

type CreatePackageRequest

type CreatePackageRequest struct {

	// Types that are assignable to Package:
	//
	//	*CreatePackageRequest_Info
	//	*CreatePackageRequest_Contents
	Package isCreatePackageRequest_Package `protobuf_oneof:"package"`
	// contains filtered or unexported fields
}

func (*CreatePackageRequest) Descriptor deprecated

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

Deprecated: Use CreatePackageRequest.ProtoReflect.Descriptor instead.

func (*CreatePackageRequest) GetContents

func (x *CreatePackageRequest) GetContents() []byte

func (*CreatePackageRequest) GetInfo

func (x *CreatePackageRequest) GetInfo() *PackageInfo

func (*CreatePackageRequest) GetPackage

func (m *CreatePackageRequest) GetPackage() isCreatePackageRequest_Package

func (*CreatePackageRequest) ProtoMessage

func (*CreatePackageRequest) ProtoMessage()

func (*CreatePackageRequest) ProtoReflect

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

func (*CreatePackageRequest) Reset

func (x *CreatePackageRequest) Reset()

func (*CreatePackageRequest) String

func (x *CreatePackageRequest) String() string

type CreatePackageRequest_Contents

type CreatePackageRequest_Contents struct {
	// .tar.gz file
	Contents []byte `protobuf:"bytes,2,opt,name=contents,proto3,oneof"`
}

type CreatePackageRequest_Info

type CreatePackageRequest_Info struct {
	Info *PackageInfo `protobuf:"bytes,1,opt,name=info,proto3,oneof"`
}

type CreatePackageResponse

type CreatePackageResponse struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

Returns the package ID and version which are populated in GetPackageRequest and DeletePackageRequest to retrieve or delete this package.

func (*CreatePackageResponse) Descriptor deprecated

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

Deprecated: Use CreatePackageResponse.ProtoReflect.Descriptor instead.

func (*CreatePackageResponse) GetId added in v0.1.65

func (x *CreatePackageResponse) GetId() string

func (*CreatePackageResponse) GetVersion added in v0.1.65

func (x *CreatePackageResponse) GetVersion() string

func (*CreatePackageResponse) ProtoMessage

func (*CreatePackageResponse) ProtoMessage()

func (*CreatePackageResponse) ProtoReflect

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

func (*CreatePackageResponse) Reset

func (x *CreatePackageResponse) Reset()

func (*CreatePackageResponse) String

func (x *CreatePackageResponse) String() string

type DeletePackageRequest

type DeletePackageRequest struct {
	Id      string      `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Version string      `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	Type    PackageType `protobuf:"varint,3,opt,name=type,proto3,enum=viam.app.packages.v1.PackageType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*DeletePackageRequest) Descriptor deprecated

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

Deprecated: Use DeletePackageRequest.ProtoReflect.Descriptor instead.

func (*DeletePackageRequest) GetId added in v0.1.65

func (x *DeletePackageRequest) GetId() string

func (*DeletePackageRequest) GetType added in v0.1.171

func (x *DeletePackageRequest) GetType() PackageType

func (*DeletePackageRequest) GetVersion added in v0.1.48

func (x *DeletePackageRequest) GetVersion() string

func (*DeletePackageRequest) ProtoMessage

func (*DeletePackageRequest) ProtoMessage()

func (*DeletePackageRequest) ProtoReflect

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

func (*DeletePackageRequest) Reset

func (x *DeletePackageRequest) Reset()

func (*DeletePackageRequest) String

func (x *DeletePackageRequest) String() string

type DeletePackageResponse

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

func (*DeletePackageResponse) Descriptor deprecated

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

Deprecated: Use DeletePackageResponse.ProtoReflect.Descriptor instead.

func (*DeletePackageResponse) ProtoMessage

func (*DeletePackageResponse) ProtoMessage()

func (*DeletePackageResponse) ProtoReflect

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

func (*DeletePackageResponse) Reset

func (x *DeletePackageResponse) Reset()

func (*DeletePackageResponse) String

func (x *DeletePackageResponse) String() string

type FileInfo

type FileInfo struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Size uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
	// contains filtered or unexported fields
}

func (*FileInfo) Descriptor deprecated

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

Deprecated: Use FileInfo.ProtoReflect.Descriptor instead.

func (*FileInfo) GetName

func (x *FileInfo) GetName() string

func (*FileInfo) GetSize

func (x *FileInfo) GetSize() uint64

func (*FileInfo) ProtoMessage

func (*FileInfo) ProtoMessage()

func (*FileInfo) ProtoReflect

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

func (*FileInfo) Reset

func (x *FileInfo) Reset()

func (*FileInfo) String

func (x *FileInfo) String() string

type GetPackageRequest

type GetPackageRequest struct {
	Id         string       `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Version    string       `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	IncludeUrl *bool        `protobuf:"varint,3,opt,name=include_url,json=includeUrl,proto3,oneof" json:"include_url,omitempty"`
	Type       *PackageType `protobuf:"varint,4,opt,name=type,proto3,enum=viam.app.packages.v1.PackageType,oneof" json:"type,omitempty"`
	Platform   *string      `protobuf:"bytes,5,opt,name=platform,proto3,oneof" json:"platform,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPackageRequest) Descriptor deprecated

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

Deprecated: Use GetPackageRequest.ProtoReflect.Descriptor instead.

func (*GetPackageRequest) GetId added in v0.1.65

func (x *GetPackageRequest) GetId() string

func (*GetPackageRequest) GetIncludeUrl added in v0.1.68

func (x *GetPackageRequest) GetIncludeUrl() bool

func (*GetPackageRequest) GetPlatform added in v0.1.138

func (x *GetPackageRequest) GetPlatform() string

func (*GetPackageRequest) GetType added in v0.1.138

func (x *GetPackageRequest) GetType() PackageType

func (*GetPackageRequest) GetVersion

func (x *GetPackageRequest) GetVersion() string

func (*GetPackageRequest) ProtoMessage

func (*GetPackageRequest) ProtoMessage()

func (*GetPackageRequest) ProtoReflect

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

func (*GetPackageRequest) Reset

func (x *GetPackageRequest) Reset()

func (*GetPackageRequest) String

func (x *GetPackageRequest) String() string

type GetPackageResponse

type GetPackageResponse struct {
	Package *Package `protobuf:"bytes,1,opt,name=package,proto3" json:"package,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPackageResponse) Descriptor deprecated

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

Deprecated: Use GetPackageResponse.ProtoReflect.Descriptor instead.

func (*GetPackageResponse) GetPackage

func (x *GetPackageResponse) GetPackage() *Package

func (*GetPackageResponse) ProtoMessage

func (*GetPackageResponse) ProtoMessage()

func (*GetPackageResponse) ProtoReflect

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

func (*GetPackageResponse) Reset

func (x *GetPackageResponse) Reset()

func (*GetPackageResponse) String

func (x *GetPackageResponse) String() string

type ListPackagesRequest

type ListPackagesRequest struct {
	OrganizationId string       `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"`
	Name           *string      `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"`
	Version        *string      `protobuf:"bytes,3,opt,name=version,proto3,oneof" json:"version,omitempty"`
	Type           *PackageType `protobuf:"varint,4,opt,name=type,proto3,enum=viam.app.packages.v1.PackageType,oneof" json:"type,omitempty"`
	IncludeUrl     *bool        `protobuf:"varint,5,opt,name=include_url,json=includeUrl,proto3,oneof" json:"include_url,omitempty"`
	// contains filtered or unexported fields
}

func (*ListPackagesRequest) Descriptor deprecated

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

Deprecated: Use ListPackagesRequest.ProtoReflect.Descriptor instead.

func (*ListPackagesRequest) GetIncludeUrl added in v0.1.68

func (x *ListPackagesRequest) GetIncludeUrl() bool

func (*ListPackagesRequest) GetName

func (x *ListPackagesRequest) GetName() string

func (*ListPackagesRequest) GetOrganizationId

func (x *ListPackagesRequest) GetOrganizationId() string

func (*ListPackagesRequest) GetType

func (x *ListPackagesRequest) GetType() PackageType

func (*ListPackagesRequest) GetVersion

func (x *ListPackagesRequest) GetVersion() string

func (*ListPackagesRequest) ProtoMessage

func (*ListPackagesRequest) ProtoMessage()

func (*ListPackagesRequest) ProtoReflect

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

func (*ListPackagesRequest) Reset

func (x *ListPackagesRequest) Reset()

func (*ListPackagesRequest) String

func (x *ListPackagesRequest) String() string

type ListPackagesResponse

type ListPackagesResponse struct {
	Packages []*Package `protobuf:"bytes,1,rep,name=packages,proto3" json:"packages,omitempty"`
	// contains filtered or unexported fields
}

func (*ListPackagesResponse) Descriptor deprecated

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

Deprecated: Use ListPackagesResponse.ProtoReflect.Descriptor instead.

func (*ListPackagesResponse) GetPackages

func (x *ListPackagesResponse) GetPackages() []*Package

func (*ListPackagesResponse) ProtoMessage

func (*ListPackagesResponse) ProtoMessage()

func (*ListPackagesResponse) ProtoReflect

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

func (*ListPackagesResponse) Reset

func (x *ListPackagesResponse) Reset()

func (*ListPackagesResponse) String

func (x *ListPackagesResponse) String() string

type Package

type Package struct {
	Info      *PackageInfo           `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"`
	Url       string                 `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	CreatedOn *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_on,json=createdOn,proto3" json:"created_on,omitempty"`
	Checksum  string                 `protobuf:"bytes,4,opt,name=checksum,proto3" json:"checksum,omitempty"`
	Id        string                 `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*Package) Descriptor deprecated

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

Deprecated: Use Package.ProtoReflect.Descriptor instead.

func (*Package) GetChecksum added in v0.1.54

func (x *Package) GetChecksum() string

func (*Package) GetCreatedOn added in v0.1.32

func (x *Package) GetCreatedOn() *timestamppb.Timestamp

func (*Package) GetId added in v0.1.65

func (x *Package) GetId() string

func (*Package) GetInfo

func (x *Package) GetInfo() *PackageInfo

func (*Package) GetUrl added in v0.1.50

func (x *Package) GetUrl() string

func (*Package) ProtoMessage

func (*Package) ProtoMessage()

func (*Package) ProtoReflect

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

func (*Package) Reset

func (x *Package) Reset()

func (*Package) String

func (x *Package) String() string

type PackageInfo

type PackageInfo struct {
	OrganizationId string           `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"`
	Name           string           `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Version        string           `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	Type           PackageType      `protobuf:"varint,4,opt,name=type,proto3,enum=viam.app.packages.v1.PackageType" json:"type,omitempty"`
	Platform       *string          `protobuf:"bytes,7,opt,name=platform,proto3,oneof" json:"platform,omitempty"`
	Files          []*FileInfo      `protobuf:"bytes,5,rep,name=files,proto3" json:"files,omitempty"`
	Metadata       *structpb.Struct `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

func (*PackageInfo) Descriptor deprecated

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

Deprecated: Use PackageInfo.ProtoReflect.Descriptor instead.

func (*PackageInfo) GetFiles

func (x *PackageInfo) GetFiles() []*FileInfo

func (*PackageInfo) GetMetadata

func (x *PackageInfo) GetMetadata() *structpb.Struct

func (*PackageInfo) GetName

func (x *PackageInfo) GetName() string

func (*PackageInfo) GetOrganizationId

func (x *PackageInfo) GetOrganizationId() string

func (*PackageInfo) GetPlatform added in v0.1.151

func (x *PackageInfo) GetPlatform() string

func (*PackageInfo) GetType

func (x *PackageInfo) GetType() PackageType

func (*PackageInfo) GetVersion

func (x *PackageInfo) GetVersion() string

func (*PackageInfo) ProtoMessage

func (*PackageInfo) ProtoMessage()

func (*PackageInfo) ProtoReflect

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

func (*PackageInfo) Reset

func (x *PackageInfo) Reset()

func (*PackageInfo) String

func (x *PackageInfo) String() string

type PackageServiceClient

type PackageServiceClient interface {
	// CreatePackage uploads a package to the cloud
	CreatePackage(ctx context.Context, opts ...grpc.CallOption) (PackageService_CreatePackageClient, error)
	// DeletePackage removes the given package versions
	DeletePackage(ctx context.Context, in *DeletePackageRequest, opts ...grpc.CallOption) (*DeletePackageResponse, error)
	// GetPackage returns the metadata for a requested package version. It also returns a URL
	// for downloading the package if one is requested.
	GetPackage(ctx context.Context, in *GetPackageRequest, opts ...grpc.CallOption) (*GetPackageResponse, error)
	// ListPackages gets the metadata for the requested packages. Includes package name, version, and/or
	// type to filter beyond the required organization_id. ListPackages also returns URLs for
	// downloading each package if they are requested.
	ListPackages(ctx context.Context, in *ListPackagesRequest, opts ...grpc.CallOption) (*ListPackagesResponse, error)
}

PackageServiceClient is the client API for PackageService 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 PackageServiceServer

type PackageServiceServer interface {
	// CreatePackage uploads a package to the cloud
	CreatePackage(PackageService_CreatePackageServer) error
	// DeletePackage removes the given package versions
	DeletePackage(context.Context, *DeletePackageRequest) (*DeletePackageResponse, error)
	// GetPackage returns the metadata for a requested package version. It also returns a URL
	// for downloading the package if one is requested.
	GetPackage(context.Context, *GetPackageRequest) (*GetPackageResponse, error)
	// ListPackages gets the metadata for the requested packages. Includes package name, version, and/or
	// type to filter beyond the required organization_id. ListPackages also returns URLs for
	// downloading each package if they are requested.
	ListPackages(context.Context, *ListPackagesRequest) (*ListPackagesResponse, error)
	// contains filtered or unexported methods
}

PackageServiceServer is the server API for PackageService service. All implementations must embed UnimplementedPackageServiceServer for forward compatibility

type PackageService_CreatePackageClient

type PackageService_CreatePackageClient interface {
	Send(*CreatePackageRequest) error
	CloseAndRecv() (*CreatePackageResponse, error)
	grpc.ClientStream
}

type PackageService_CreatePackageServer

type PackageService_CreatePackageServer interface {
	SendAndClose(*CreatePackageResponse) error
	Recv() (*CreatePackageRequest, error)
	grpc.ServerStream
}

type PackageType

type PackageType int32
const (
	PackageType_PACKAGE_TYPE_UNSPECIFIED PackageType = 0
	PackageType_PACKAGE_TYPE_ARCHIVE     PackageType = 1
	PackageType_PACKAGE_TYPE_ML_MODEL    PackageType = 2
	PackageType_PACKAGE_TYPE_MODULE      PackageType = 3
	PackageType_PACKAGE_TYPE_SLAM_MAP    PackageType = 4
	PackageType_PACKAGE_TYPE_ML_TRAINING PackageType = 5
)

func (PackageType) Descriptor

func (PackageType) Enum

func (x PackageType) Enum() *PackageType

func (PackageType) EnumDescriptor deprecated

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

Deprecated: Use PackageType.Descriptor instead.

func (PackageType) Number

func (x PackageType) Number() protoreflect.EnumNumber

func (PackageType) String

func (x PackageType) String() string

func (PackageType) Type

type UnimplementedPackageServiceServer

type UnimplementedPackageServiceServer struct {
}

UnimplementedPackageServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedPackageServiceServer) CreatePackage

func (UnimplementedPackageServiceServer) DeletePackage

func (UnimplementedPackageServiceServer) GetPackage

func (UnimplementedPackageServiceServer) ListPackages

type UnsafePackageServiceServer

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

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

Jump to

Keyboard shortcuts

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