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: 16 Imported by: 2

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 (
	JobStatus_name = map[int32]string{
		0: "JOB_STATUS_UNSPECIFIED",
		1: "JOB_STATUS_IN_PROGRESS",
		2: "JOB_STATUS_FAILED",
		3: "JOB_STATUS_DONE",
	}
	JobStatus_value = map[string]int32{
		"JOB_STATUS_UNSPECIFIED": 0,
		"JOB_STATUS_IN_PROGRESS": 1,
		"JOB_STATUS_FAILED":      2,
		"JOB_STATUS_DONE":        3,
	}
)

Enum value maps for JobStatus.

View Source
var BuildService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "viam.app.build.v1.BuildService",
	HandlerType: (*BuildServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "StartBuild",
			Handler:    _BuildService_StartBuild_Handler,
		},
		{
			MethodName: "ListJobs",
			Handler:    _BuildService_ListJobs_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetLogs",
			Handler:       _BuildService_GetLogs_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "app/build/v1/build.proto",
}

BuildService_ServiceDesc is the grpc.ServiceDesc for BuildService 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 File_app_build_v1_build_proto protoreflect.FileDescriptor

Functions

func RegisterBuildServiceHandler

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

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

func RegisterBuildServiceHandlerClient

func RegisterBuildServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BuildServiceClient) error

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

func RegisterBuildServiceHandlerFromEndpoint

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

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

func RegisterBuildServiceHandlerServer

func RegisterBuildServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BuildServiceServer) error

RegisterBuildServiceHandlerServer registers the http handlers for service BuildService to "mux". UnaryRPC :call BuildServiceServer 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 RegisterBuildServiceHandlerFromEndpoint instead.

func RegisterBuildServiceServer

func RegisterBuildServiceServer(s grpc.ServiceRegistrar, srv BuildServiceServer)

Types

type BuildServiceClient

type BuildServiceClient interface {
	// Asynchronously start a build of a Viam module, with one job per platform.
	StartBuild(ctx context.Context, in *StartBuildRequest, opts ...grpc.CallOption) (*StartBuildResponse, error)
	// Fetch logs from a single job of a single build.
	GetLogs(ctx context.Context, in *GetLogsRequest, opts ...grpc.CallOption) (BuildService_GetLogsClient, error)
	// List the jobs for a module ordered by (build start time, alphabetical platform).
	ListJobs(ctx context.Context, in *ListJobsRequest, opts ...grpc.CallOption) (*ListJobsResponse, error)
}

BuildServiceClient is the client API for BuildService 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 BuildServiceServer

type BuildServiceServer interface {
	// Asynchronously start a build of a Viam module, with one job per platform.
	StartBuild(context.Context, *StartBuildRequest) (*StartBuildResponse, error)
	// Fetch logs from a single job of a single build.
	GetLogs(*GetLogsRequest, BuildService_GetLogsServer) error
	// List the jobs for a module ordered by (build start time, alphabetical platform).
	ListJobs(context.Context, *ListJobsRequest) (*ListJobsResponse, error)
	// contains filtered or unexported methods
}

BuildServiceServer is the server API for BuildService service. All implementations must embed UnimplementedBuildServiceServer for forward compatibility

type BuildService_GetLogsClient

type BuildService_GetLogsClient interface {
	Recv() (*GetLogsResponse, error)
	grpc.ClientStream
}

type BuildService_GetLogsServer

type BuildService_GetLogsServer interface {
	Send(*GetLogsResponse) error
	grpc.ServerStream
}

type GetLogsRequest

type GetLogsRequest struct {
	BuildId  string `protobuf:"bytes,1,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"`
	Platform string `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform,omitempty"`
	// contains filtered or unexported fields
}

func (*GetLogsRequest) Descriptor deprecated

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

Deprecated: Use GetLogsRequest.ProtoReflect.Descriptor instead.

func (*GetLogsRequest) GetBuildId

func (x *GetLogsRequest) GetBuildId() string

func (*GetLogsRequest) GetPlatform

func (x *GetLogsRequest) GetPlatform() string

func (*GetLogsRequest) ProtoMessage

func (*GetLogsRequest) ProtoMessage()

func (*GetLogsRequest) ProtoReflect

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

func (*GetLogsRequest) Reset

func (x *GetLogsRequest) Reset()

func (*GetLogsRequest) String

func (x *GetLogsRequest) String() string

type GetLogsResponse

type GetLogsResponse struct {
	BuildStep string `protobuf:"bytes,1,opt,name=build_step,json=buildStep,proto3" json:"build_step,omitempty"`
	// includes multiple lines delimited by \n\r
	Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

GetLogsResponse is a streaming endpoint that may have multiple messages that belong to the same build_step if there are too many bytes to fit into a single gRPC response.

func (*GetLogsResponse) Descriptor deprecated

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

Deprecated: Use GetLogsResponse.ProtoReflect.Descriptor instead.

func (*GetLogsResponse) GetBuildStep

func (x *GetLogsResponse) GetBuildStep() string

func (*GetLogsResponse) GetData

func (x *GetLogsResponse) GetData() string

func (*GetLogsResponse) ProtoMessage

func (*GetLogsResponse) ProtoMessage()

func (*GetLogsResponse) ProtoReflect

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

func (*GetLogsResponse) Reset

func (x *GetLogsResponse) Reset()

func (*GetLogsResponse) String

func (x *GetLogsResponse) String() string

type JobInfo

type JobInfo struct {
	BuildId   string                 `protobuf:"bytes,1,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"`
	Platform  string                 `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform,omitempty"`
	Version   string                 `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	Status    JobStatus              `protobuf:"varint,4,opt,name=status,proto3,enum=viam.app.build.v1.JobStatus" json:"status,omitempty"`
	StartTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	EndTime   *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=end_time,json=endTime,proto3,oneof" json:"end_time,omitempty"`
	// contains filtered or unexported fields
}

func (*JobInfo) Descriptor deprecated

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

Deprecated: Use JobInfo.ProtoReflect.Descriptor instead.

func (*JobInfo) GetBuildId

func (x *JobInfo) GetBuildId() string

func (*JobInfo) GetEndTime

func (x *JobInfo) GetEndTime() *timestamppb.Timestamp

func (*JobInfo) GetPlatform

func (x *JobInfo) GetPlatform() string

func (*JobInfo) GetStartTime

func (x *JobInfo) GetStartTime() *timestamppb.Timestamp

func (*JobInfo) GetStatus

func (x *JobInfo) GetStatus() JobStatus

func (*JobInfo) GetVersion

func (x *JobInfo) GetVersion() string

func (*JobInfo) ProtoMessage

func (*JobInfo) ProtoMessage()

func (*JobInfo) ProtoReflect

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

func (*JobInfo) Reset

func (x *JobInfo) Reset()

func (*JobInfo) String

func (x *JobInfo) String() string

type JobStatus

type JobStatus int32
const (
	JobStatus_JOB_STATUS_UNSPECIFIED JobStatus = 0
	// IN_PROGRESS = pending or executing on cloud infra. Artifact has not been uploaded.
	JobStatus_JOB_STATUS_IN_PROGRESS JobStatus = 1
	JobStatus_JOB_STATUS_FAILED      JobStatus = 2
	JobStatus_JOB_STATUS_DONE        JobStatus = 3
)

func (JobStatus) Descriptor

func (JobStatus) Descriptor() protoreflect.EnumDescriptor

func (JobStatus) Enum

func (x JobStatus) Enum() *JobStatus

func (JobStatus) EnumDescriptor deprecated

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

Deprecated: Use JobStatus.Descriptor instead.

func (JobStatus) Number

func (x JobStatus) Number() protoreflect.EnumNumber

func (JobStatus) String

func (x JobStatus) String() string

func (JobStatus) Type

type ListJobsRequest

type ListJobsRequest struct {

	// module_id as prefix:name pair
	ModuleId string `protobuf:"bytes,1,opt,name=module_id,json=moduleId,proto3" json:"module_id,omitempty"`
	// don't return more than max_jobs_length jobs
	// if not present, return all jobs.
	MaxJobsLength *int32 `protobuf:"varint,2,opt,name=max_jobs_length,json=maxJobsLength,proto3,oneof" json:"max_jobs_length,omitempty"`
	// only return jobs that match this build id
	// if not present, return all jobs.
	BuildId *string `protobuf:"bytes,3,opt,name=build_id,json=buildId,proto3,oneof" json:"build_id,omitempty"`
	// contains filtered or unexported fields
}

func (*ListJobsRequest) Descriptor deprecated

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

Deprecated: Use ListJobsRequest.ProtoReflect.Descriptor instead.

func (*ListJobsRequest) GetBuildId

func (x *ListJobsRequest) GetBuildId() string

func (*ListJobsRequest) GetMaxJobsLength

func (x *ListJobsRequest) GetMaxJobsLength() int32

func (*ListJobsRequest) GetModuleId

func (x *ListJobsRequest) GetModuleId() string

func (*ListJobsRequest) ProtoMessage

func (*ListJobsRequest) ProtoMessage()

func (*ListJobsRequest) ProtoReflect

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

func (*ListJobsRequest) Reset

func (x *ListJobsRequest) Reset()

func (*ListJobsRequest) String

func (x *ListJobsRequest) String() string

type ListJobsResponse

type ListJobsResponse struct {

	// jobs is ordered by (build start time, alphabetical platform).
	Jobs []*JobInfo `protobuf:"bytes,1,rep,name=jobs,proto3" json:"jobs,omitempty"`
	// contains filtered or unexported fields
}

func (*ListJobsResponse) Descriptor deprecated

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

Deprecated: Use ListJobsResponse.ProtoReflect.Descriptor instead.

func (*ListJobsResponse) GetJobs

func (x *ListJobsResponse) GetJobs() []*JobInfo

func (*ListJobsResponse) ProtoMessage

func (*ListJobsResponse) ProtoMessage()

func (*ListJobsResponse) ProtoReflect

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

func (*ListJobsResponse) Reset

func (x *ListJobsResponse) Reset()

func (*ListJobsResponse) String

func (x *ListJobsResponse) String() string

type StartBuildRequest

type StartBuildRequest struct {

	// repo to build
	Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"`
	// optional git ref; defaults to 'main'
	Ref *string `protobuf:"bytes,2,opt,name=ref,proto3,oneof" json:"ref,omitempty"`
	// list of platforms to build
	Platforms []string `protobuf:"bytes,3,rep,name=platforms,proto3" json:"platforms,omitempty"`
	// module_id as prefix:name pair
	ModuleId string `protobuf:"bytes,4,opt,name=module_id,json=moduleId,proto3" json:"module_id,omitempty"`
	// version of the module to publish
	// must be valid semver2.0 string (ex: 1.2.3-rc0)
	ModuleVersion string `protobuf:"bytes,5,opt,name=module_version,json=moduleVersion,proto3" json:"module_version,omitempty"`
	// contains filtered or unexported fields
}

func (*StartBuildRequest) Descriptor deprecated

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

Deprecated: Use StartBuildRequest.ProtoReflect.Descriptor instead.

func (*StartBuildRequest) GetModuleId

func (x *StartBuildRequest) GetModuleId() string

func (*StartBuildRequest) GetModuleVersion

func (x *StartBuildRequest) GetModuleVersion() string

func (*StartBuildRequest) GetPlatforms

func (x *StartBuildRequest) GetPlatforms() []string

func (*StartBuildRequest) GetRef

func (x *StartBuildRequest) GetRef() string

func (*StartBuildRequest) GetRepo

func (x *StartBuildRequest) GetRepo() string

func (*StartBuildRequest) ProtoMessage

func (*StartBuildRequest) ProtoMessage()

func (*StartBuildRequest) ProtoReflect

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

func (*StartBuildRequest) Reset

func (x *StartBuildRequest) Reset()

func (*StartBuildRequest) String

func (x *StartBuildRequest) String() string

type StartBuildResponse

type StartBuildResponse struct {
	BuildId string `protobuf:"bytes,1,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"`
	// contains filtered or unexported fields
}

func (*StartBuildResponse) Descriptor deprecated

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

Deprecated: Use StartBuildResponse.ProtoReflect.Descriptor instead.

func (*StartBuildResponse) GetBuildId

func (x *StartBuildResponse) GetBuildId() string

func (*StartBuildResponse) ProtoMessage

func (*StartBuildResponse) ProtoMessage()

func (*StartBuildResponse) ProtoReflect

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

func (*StartBuildResponse) Reset

func (x *StartBuildResponse) Reset()

func (*StartBuildResponse) String

func (x *StartBuildResponse) String() string

type UnimplementedBuildServiceServer

type UnimplementedBuildServiceServer struct {
}

UnimplementedBuildServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedBuildServiceServer) GetLogs

func (UnimplementedBuildServiceServer) ListJobs

func (UnimplementedBuildServiceServer) StartBuild

type UnsafeBuildServiceServer

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

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

Jump to

Keyboard shortcuts

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