py_runtimev1alpha1

package
v0.0.0-...-3a7d93f Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package py_runtimev1alpha1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	RuntimeService_LoadProgram_FullMethodName    = "/py_runtime.v1alpha1.RuntimeService/LoadProgram"
	RuntimeService_ExecuteProgram_FullMethodName = "/py_runtime.v1alpha1.RuntimeService/ExecuteProgram"
)

Variables

View Source
var File_py_runtime_v1alpha1_api_proto protoreflect.FileDescriptor
View Source
var RuntimeService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "py_runtime.v1alpha1.RuntimeService",
	HandlerType: (*RuntimeServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "LoadProgram",
			Handler:    _RuntimeService_LoadProgram_Handler,
		},
		{
			MethodName: "ExecuteProgram",
			Handler:    _RuntimeService_ExecuteProgram_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "py_runtime/v1alpha1/api.proto",
}

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

Functions

func RegisterRuntimeServiceHandler

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

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

func RegisterRuntimeServiceHandlerClient

func RegisterRuntimeServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RuntimeServiceClient) error

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

func RegisterRuntimeServiceHandlerFromEndpoint

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

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

func RegisterRuntimeServiceHandlerServer

func RegisterRuntimeServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RuntimeServiceServer) error

RegisterRuntimeServiceHandlerServer registers the http handlers for service RuntimeService to "mux". UnaryRPC :call RuntimeServiceServer 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 RegisterRuntimeServiceHandlerFromEndpoint instead.

func RegisterRuntimeServiceServer

func RegisterRuntimeServiceServer(s grpc.ServiceRegistrar, srv RuntimeServiceServer)

Types

type ExecuteProgramRequest

type ExecuteProgramRequest struct {

	// UUID of the request.
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	// Fully qualified name of the feature owning the program to execute.
	Fqn string `protobuf:"bytes,2,opt,name=fqn,proto3" json:"fqn,omitempty"`
	// Keys for the feature. The keys are used to identify the feature instance.
	Keys map[string]string `` /* 149-byte string literal not displayed */
	// Data to pass to the program.
	Data map[string]*v1alpha1.Value `` /* 149-byte string literal not displayed */
	// Timestamp of the request.
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// DryRun the program without side effects (e.g. don't save the result).
	DryRun bool `protobuf:"varint,6,opt,name=dry_run,json=dryRun,proto3" json:"dry_run,omitempty"`
	// contains filtered or unexported fields
}

EntityReadRequest is a request to read an entity.

func (*ExecuteProgramRequest) Descriptor deprecated

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

Deprecated: Use ExecuteProgramRequest.ProtoReflect.Descriptor instead.

func (*ExecuteProgramRequest) GetData

func (x *ExecuteProgramRequest) GetData() map[string]*v1alpha1.Value

func (*ExecuteProgramRequest) GetDryRun

func (x *ExecuteProgramRequest) GetDryRun() bool

func (*ExecuteProgramRequest) GetFqn

func (x *ExecuteProgramRequest) GetFqn() string

func (*ExecuteProgramRequest) GetKeys

func (x *ExecuteProgramRequest) GetKeys() map[string]string

func (*ExecuteProgramRequest) GetTimestamp

func (x *ExecuteProgramRequest) GetTimestamp() *timestamppb.Timestamp

func (*ExecuteProgramRequest) GetUuid

func (x *ExecuteProgramRequest) GetUuid() string

func (*ExecuteProgramRequest) ProtoMessage

func (*ExecuteProgramRequest) ProtoMessage()

func (*ExecuteProgramRequest) ProtoReflect

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

func (*ExecuteProgramRequest) Reset

func (x *ExecuteProgramRequest) Reset()

func (*ExecuteProgramRequest) String

func (x *ExecuteProgramRequest) String() string

func (*ExecuteProgramRequest) Validate

func (m *ExecuteProgramRequest) Validate() error

Validate checks the field values on ExecuteProgramRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ExecuteProgramRequest) ValidateAll

func (m *ExecuteProgramRequest) ValidateAll() error

ValidateAll checks the field values on ExecuteProgramRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ExecuteProgramRequestMultiError, or nil if none found.

type ExecuteProgramRequestMultiError

type ExecuteProgramRequestMultiError []error

ExecuteProgramRequestMultiError is an error wrapping multiple validation errors returned by ExecuteProgramRequest.ValidateAll() if the designated constraints aren't met.

func (ExecuteProgramRequestMultiError) AllErrors

func (m ExecuteProgramRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ExecuteProgramRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type ExecuteProgramRequestValidationError

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

ExecuteProgramRequestValidationError is the validation error returned by ExecuteProgramRequest.Validate if the designated constraints aren't met.

func (ExecuteProgramRequestValidationError) Cause

Cause function returns cause value.

func (ExecuteProgramRequestValidationError) Error

Error satisfies the builtin error interface

func (ExecuteProgramRequestValidationError) ErrorName

ErrorName returns error name.

func (ExecuteProgramRequestValidationError) Field

Field function returns field value.

func (ExecuteProgramRequestValidationError) Key

Key function returns key value.

func (ExecuteProgramRequestValidationError) Reason

Reason function returns reason value.

type ExecuteProgramResponse

type ExecuteProgramResponse struct {

	// UUID corresponding to the request.
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	// Result of the program execution.
	Result *v1alpha1.Value `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"`
	// Keys for the feature. The keys are used to identify the feature instance.
	Keys map[string]string `` /* 149-byte string literal not displayed */
	// Timestamp of the response.
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

EntityReadResponse is a response to a read entity request.

func (*ExecuteProgramResponse) Descriptor deprecated

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

Deprecated: Use ExecuteProgramResponse.ProtoReflect.Descriptor instead.

func (*ExecuteProgramResponse) GetKeys

func (x *ExecuteProgramResponse) GetKeys() map[string]string

func (*ExecuteProgramResponse) GetResult

func (x *ExecuteProgramResponse) GetResult() *v1alpha1.Value

func (*ExecuteProgramResponse) GetTimestamp

func (x *ExecuteProgramResponse) GetTimestamp() *timestamppb.Timestamp

func (*ExecuteProgramResponse) GetUuid

func (x *ExecuteProgramResponse) GetUuid() string

func (*ExecuteProgramResponse) ProtoMessage

func (*ExecuteProgramResponse) ProtoMessage()

func (*ExecuteProgramResponse) ProtoReflect

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

func (*ExecuteProgramResponse) Reset

func (x *ExecuteProgramResponse) Reset()

func (*ExecuteProgramResponse) String

func (x *ExecuteProgramResponse) String() string

func (*ExecuteProgramResponse) Validate

func (m *ExecuteProgramResponse) Validate() error

Validate checks the field values on ExecuteProgramResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ExecuteProgramResponse) ValidateAll

func (m *ExecuteProgramResponse) ValidateAll() error

ValidateAll checks the field values on ExecuteProgramResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ExecuteProgramResponseMultiError, or nil if none found.

type ExecuteProgramResponseMultiError

type ExecuteProgramResponseMultiError []error

ExecuteProgramResponseMultiError is an error wrapping multiple validation errors returned by ExecuteProgramResponse.ValidateAll() if the designated constraints aren't met.

func (ExecuteProgramResponseMultiError) AllErrors

func (m ExecuteProgramResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ExecuteProgramResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type ExecuteProgramResponseValidationError

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

ExecuteProgramResponseValidationError is the validation error returned by ExecuteProgramResponse.Validate if the designated constraints aren't met.

func (ExecuteProgramResponseValidationError) Cause

Cause function returns cause value.

func (ExecuteProgramResponseValidationError) Error

Error satisfies the builtin error interface

func (ExecuteProgramResponseValidationError) ErrorName

ErrorName returns error name.

func (ExecuteProgramResponseValidationError) Field

Field function returns field value.

func (ExecuteProgramResponseValidationError) Key

Key function returns key value.

func (ExecuteProgramResponseValidationError) Reason

Reason function returns reason value.

type LoadProgramRequest

type LoadProgramRequest struct {

	// UUID of the request.
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	// Fully qualified name of the feature owning the program.
	Fqn string `protobuf:"bytes,2,opt,name=fqn,proto3" json:"fqn,omitempty"`
	// Program python code to load.
	Program string `protobuf:"bytes,3,opt,name=program,proto3" json:"program,omitempty"`
	// Packages to install before loading the program. Pip expressions are supported.
	Packages []string `protobuf:"bytes,4,rep,name=packages,proto3" json:"packages,omitempty"`
	// contains filtered or unexported fields
}

LoadProgramRequest is a request to load a new program to the runtime.

func (*LoadProgramRequest) Descriptor deprecated

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

Deprecated: Use LoadProgramRequest.ProtoReflect.Descriptor instead.

func (*LoadProgramRequest) GetFqn

func (x *LoadProgramRequest) GetFqn() string

func (*LoadProgramRequest) GetPackages

func (x *LoadProgramRequest) GetPackages() []string

func (*LoadProgramRequest) GetProgram

func (x *LoadProgramRequest) GetProgram() string

func (*LoadProgramRequest) GetUuid

func (x *LoadProgramRequest) GetUuid() string

func (*LoadProgramRequest) ProtoMessage

func (*LoadProgramRequest) ProtoMessage()

func (*LoadProgramRequest) ProtoReflect

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

func (*LoadProgramRequest) Reset

func (x *LoadProgramRequest) Reset()

func (*LoadProgramRequest) String

func (x *LoadProgramRequest) String() string

func (*LoadProgramRequest) Validate

func (m *LoadProgramRequest) Validate() error

Validate checks the field values on LoadProgramRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*LoadProgramRequest) ValidateAll

func (m *LoadProgramRequest) ValidateAll() error

ValidateAll checks the field values on LoadProgramRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in LoadProgramRequestMultiError, or nil if none found.

type LoadProgramRequestMultiError

type LoadProgramRequestMultiError []error

LoadProgramRequestMultiError is an error wrapping multiple validation errors returned by LoadProgramRequest.ValidateAll() if the designated constraints aren't met.

func (LoadProgramRequestMultiError) AllErrors

func (m LoadProgramRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (LoadProgramRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type LoadProgramRequestValidationError

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

LoadProgramRequestValidationError is the validation error returned by LoadProgramRequest.Validate if the designated constraints aren't met.

func (LoadProgramRequestValidationError) Cause

Cause function returns cause value.

func (LoadProgramRequestValidationError) Error

Error satisfies the builtin error interface

func (LoadProgramRequestValidationError) ErrorName

ErrorName returns error name.

func (LoadProgramRequestValidationError) Field

Field function returns field value.

func (LoadProgramRequestValidationError) Key

Key function returns key value.

func (LoadProgramRequestValidationError) Reason

Reason function returns reason value.

type LoadProgramResponse

type LoadProgramResponse struct {

	// UUID corresponding to the request.
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	// Primitive that the program will return.
	Primitive v1alpha1.Primitive `protobuf:"varint,2,opt,name=primitive,proto3,enum=core.v1alpha1.Primitive" json:"primitive,omitempty"`
	// Side effects that the program will produce.
	SideEffects []*SideEffect `protobuf:"bytes,3,rep,name=side_effects,json=sideEffects,proto3" json:"side_effects,omitempty"`
	// contains filtered or unexported fields
}

LoadProgramResponse is a response to a load program request.

func (*LoadProgramResponse) Descriptor deprecated

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

Deprecated: Use LoadProgramResponse.ProtoReflect.Descriptor instead.

func (*LoadProgramResponse) GetPrimitive

func (x *LoadProgramResponse) GetPrimitive() v1alpha1.Primitive

func (*LoadProgramResponse) GetSideEffects

func (x *LoadProgramResponse) GetSideEffects() []*SideEffect

func (*LoadProgramResponse) GetUuid

func (x *LoadProgramResponse) GetUuid() string

func (*LoadProgramResponse) ProtoMessage

func (*LoadProgramResponse) ProtoMessage()

func (*LoadProgramResponse) ProtoReflect

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

func (*LoadProgramResponse) Reset

func (x *LoadProgramResponse) Reset()

func (*LoadProgramResponse) String

func (x *LoadProgramResponse) String() string

func (*LoadProgramResponse) Validate

func (m *LoadProgramResponse) Validate() error

Validate checks the field values on LoadProgramResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*LoadProgramResponse) ValidateAll

func (m *LoadProgramResponse) ValidateAll() error

ValidateAll checks the field values on LoadProgramResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in LoadProgramResponseMultiError, or nil if none found.

type LoadProgramResponseMultiError

type LoadProgramResponseMultiError []error

LoadProgramResponseMultiError is an error wrapping multiple validation errors returned by LoadProgramResponse.ValidateAll() if the designated constraints aren't met.

func (LoadProgramResponseMultiError) AllErrors

func (m LoadProgramResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (LoadProgramResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type LoadProgramResponseValidationError

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

LoadProgramResponseValidationError is the validation error returned by LoadProgramResponse.Validate if the designated constraints aren't met.

func (LoadProgramResponseValidationError) Cause

Cause function returns cause value.

func (LoadProgramResponseValidationError) Error

Error satisfies the builtin error interface

func (LoadProgramResponseValidationError) ErrorName

ErrorName returns error name.

func (LoadProgramResponseValidationError) Field

Field function returns field value.

func (LoadProgramResponseValidationError) Key

Key function returns key value.

func (LoadProgramResponseValidationError) Reason

Reason function returns reason value.

type RuntimeServiceClient

type RuntimeServiceClient interface {
	LoadProgram(ctx context.Context, in *LoadProgramRequest, opts ...grpc.CallOption) (*LoadProgramResponse, error)
	ExecuteProgram(ctx context.Context, in *ExecuteProgramRequest, opts ...grpc.CallOption) (*ExecuteProgramResponse, error)
}

RuntimeServiceClient is the client API for RuntimeService 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 RuntimeServiceServer

type RuntimeServiceServer interface {
	LoadProgram(context.Context, *LoadProgramRequest) (*LoadProgramResponse, error)
	ExecuteProgram(context.Context, *ExecuteProgramRequest) (*ExecuteProgramResponse, error)
}

RuntimeServiceServer is the server API for RuntimeService service. All implementations should embed UnimplementedRuntimeServiceServer for forward compatibility

type SideEffect

type SideEffect struct {
	Kind        string            `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
	Args        map[string]string `` /* 149-byte string literal not displayed */
	Conditional bool              `protobuf:"varint,3,opt,name=conditional,proto3" json:"conditional,omitempty"`
	// contains filtered or unexported fields
}

SideEffect is a side effect of a program execution.

func (*SideEffect) Descriptor deprecated

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

Deprecated: Use SideEffect.ProtoReflect.Descriptor instead.

func (*SideEffect) GetArgs

func (x *SideEffect) GetArgs() map[string]string

func (*SideEffect) GetConditional

func (x *SideEffect) GetConditional() bool

func (*SideEffect) GetKind

func (x *SideEffect) GetKind() string

func (*SideEffect) ProtoMessage

func (*SideEffect) ProtoMessage()

func (*SideEffect) ProtoReflect

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

func (*SideEffect) Reset

func (x *SideEffect) Reset()

func (*SideEffect) String

func (x *SideEffect) String() string

func (*SideEffect) Validate

func (m *SideEffect) Validate() error

Validate checks the field values on SideEffect with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*SideEffect) ValidateAll

func (m *SideEffect) ValidateAll() error

ValidateAll checks the field values on SideEffect with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SideEffectMultiError, or nil if none found.

type SideEffectMultiError

type SideEffectMultiError []error

SideEffectMultiError is an error wrapping multiple validation errors returned by SideEffect.ValidateAll() if the designated constraints aren't met.

func (SideEffectMultiError) AllErrors

func (m SideEffectMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SideEffectMultiError) Error

func (m SideEffectMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type SideEffectValidationError

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

SideEffectValidationError is the validation error returned by SideEffect.Validate if the designated constraints aren't met.

func (SideEffectValidationError) Cause

func (e SideEffectValidationError) Cause() error

Cause function returns cause value.

func (SideEffectValidationError) Error

Error satisfies the builtin error interface

func (SideEffectValidationError) ErrorName

func (e SideEffectValidationError) ErrorName() string

ErrorName returns error name.

func (SideEffectValidationError) Field

Field function returns field value.

func (SideEffectValidationError) Key

Key function returns key value.

func (SideEffectValidationError) Reason

func (e SideEffectValidationError) Reason() string

Reason function returns reason value.

type UnimplementedRuntimeServiceServer

type UnimplementedRuntimeServiceServer struct {
}

UnimplementedRuntimeServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedRuntimeServiceServer) ExecuteProgram

func (UnimplementedRuntimeServiceServer) LoadProgram

type UnsafeRuntimeServiceServer

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

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

Jump to

Keyboard shortcuts

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