Documentation
¶
Overview ¶
Copyright (c) Ultraviolet SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- Variables
- func RegisterManagerServiceServer(s grpc.ServiceRegistrar, srv ManagerServiceServer)
- type AttestationPolicyReq
- func (*AttestationPolicyReq) Descriptor() ([]byte, []int)deprecated
- func (x *AttestationPolicyReq) GetId() string
- func (*AttestationPolicyReq) ProtoMessage()
- func (x *AttestationPolicyReq) ProtoReflect() protoreflect.Message
- func (x *AttestationPolicyReq) Reset()
- func (x *AttestationPolicyReq) String() string
- type AttestationPolicyRes
- func (*AttestationPolicyRes) Descriptor() ([]byte, []int)deprecated
- func (x *AttestationPolicyRes) GetId() string
- func (x *AttestationPolicyRes) GetInfo() []byte
- func (*AttestationPolicyRes) ProtoMessage()
- func (x *AttestationPolicyRes) ProtoReflect() protoreflect.Message
- func (x *AttestationPolicyRes) Reset()
- func (x *AttestationPolicyRes) String() string
- type CreateReq
- func (*CreateReq) Descriptor() ([]byte, []int)deprecated
- func (x *CreateReq) GetAgentCvmClientCert() []byte
- func (x *CreateReq) GetAgentCvmClientKey() []byte
- func (x *CreateReq) GetAgentCvmServerCaCert() []byte
- func (x *CreateReq) GetAgentCvmServerUrl() string
- func (x *CreateReq) GetAgentLogLevel() string
- func (*CreateReq) ProtoMessage()
- func (x *CreateReq) ProtoReflect() protoreflect.Message
- func (x *CreateReq) Reset()
- func (x *CreateReq) String() string
- type CreateRes
- type ManagerServiceClient
- type ManagerServiceServer
- type RemoveReq
- type SVMInfoReq
- type SVMInfoRes
- func (*SVMInfoRes) Descriptor() ([]byte, []int)deprecated
- func (x *SVMInfoRes) GetCpuNum() int32
- func (x *SVMInfoRes) GetCpuType() string
- func (x *SVMInfoRes) GetEosVersion() string
- func (x *SVMInfoRes) GetId() string
- func (x *SVMInfoRes) GetKernelCmd() string
- func (x *SVMInfoRes) GetOvmfVersion() string
- func (*SVMInfoRes) ProtoMessage()
- func (x *SVMInfoRes) ProtoReflect() protoreflect.Message
- func (x *SVMInfoRes) Reset()
- func (x *SVMInfoRes) String() string
- type Service
- type UnimplementedManagerServiceServer
- func (UnimplementedManagerServiceServer) AttestationPolicy(context.Context, *AttestationPolicyReq) (*AttestationPolicyRes, error)
- func (UnimplementedManagerServiceServer) CreateVm(context.Context, *CreateReq) (*CreateRes, error)
- func (UnimplementedManagerServiceServer) RemoveVm(context.Context, *RemoveReq) (*emptypb.Empty, error)
- func (UnimplementedManagerServiceServer) SVMInfo(context.Context, *SVMInfoReq) (*SVMInfoRes, error)
- type UnsafeManagerServiceServer
Constants ¶
const ( ManagerService_CreateVm_FullMethodName = "/manager.ManagerService/CreateVm" ManagerService_RemoveVm_FullMethodName = "/manager.ManagerService/RemoveVm" ManagerService_SVMInfo_FullMethodName = "/manager.ManagerService/SVMInfo" ManagerService_AttestationPolicy_FullMethodName = "/manager.ManagerService/AttestationPolicy" )
Variables ¶
var ( // ErrMalformedEntity indicates malformed entity specification (e.g. // invalid username or password). ErrMalformedEntity = errors.New("malformed entity specification") // when accessing a protected resource. ErrUnauthorizedAccess = errors.New("missing or invalid credentials provided") // ErrNotFound indicates a non-existent entity request. ErrNotFound = errors.New("entity not found") // ErrFailedToAllocatePort indicates no free port was found on host. ErrFailedToAllocatePort = errors.New("failed to allocate free port on host") // ErrFailedToCalculateHash indicates that agent computation returned an error while calculating the hash of the computation. ErrFailedToCalculateHash = errors.New("error while calculating the hash of the computation") // ErrFailedToCreateAttestationPolicy indicates that the script to create the attestation policy failed to execute. ErrFailedToCreateAttestationPolicy = errors.New("error while creating attestation policy") // ErrFailedToReadPolicy indicates that the file for attestation policy could not be opened. ErrFailedToReadPolicy = errors.New("error while opening file attestation policy") // ErrUnmarshalFailed indicates that the file for the attestation policy could not be unmarshaled. ErrUnmarshalFailed = errors.New("error while unmarshaling the attestation policy") )
var File_manager_manager_proto protoreflect.FileDescriptor
var ManagerService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "manager.ManagerService", HandlerType: (*ManagerServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateVm", Handler: _ManagerService_CreateVm_Handler, }, { MethodName: "RemoveVm", Handler: _ManagerService_RemoveVm_Handler, }, { MethodName: "SVMInfo", Handler: _ManagerService_SVMInfo_Handler, }, { MethodName: "AttestationPolicy", Handler: _ManagerService_AttestationPolicy_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "manager/manager.proto", }
ManagerService_ServiceDesc is the grpc.ServiceDesc for ManagerService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterManagerServiceServer ¶
func RegisterManagerServiceServer(s grpc.ServiceRegistrar, srv ManagerServiceServer)
Types ¶
type AttestationPolicyReq ¶ added in v0.4.0
type AttestationPolicyReq struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*AttestationPolicyReq) Descriptor
deprecated
added in
v0.4.0
func (*AttestationPolicyReq) Descriptor() ([]byte, []int)
Deprecated: Use AttestationPolicyReq.ProtoReflect.Descriptor instead.
func (*AttestationPolicyReq) GetId ¶ added in v0.4.0
func (x *AttestationPolicyReq) GetId() string
func (*AttestationPolicyReq) ProtoMessage ¶ added in v0.4.0
func (*AttestationPolicyReq) ProtoMessage()
func (*AttestationPolicyReq) ProtoReflect ¶ added in v0.4.0
func (x *AttestationPolicyReq) ProtoReflect() protoreflect.Message
func (*AttestationPolicyReq) Reset ¶ added in v0.4.0
func (x *AttestationPolicyReq) Reset()
func (*AttestationPolicyReq) String ¶ added in v0.4.0
func (x *AttestationPolicyReq) String() string
type AttestationPolicyRes ¶ added in v0.5.0
type AttestationPolicyRes struct { Info []byte `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*AttestationPolicyRes) Descriptor
deprecated
added in
v0.5.0
func (*AttestationPolicyRes) Descriptor() ([]byte, []int)
Deprecated: Use AttestationPolicyRes.ProtoReflect.Descriptor instead.
func (*AttestationPolicyRes) GetId ¶ added in v0.5.0
func (x *AttestationPolicyRes) GetId() string
func (*AttestationPolicyRes) GetInfo ¶ added in v0.5.0
func (x *AttestationPolicyRes) GetInfo() []byte
func (*AttestationPolicyRes) ProtoMessage ¶ added in v0.5.0
func (*AttestationPolicyRes) ProtoMessage()
func (*AttestationPolicyRes) ProtoReflect ¶ added in v0.5.0
func (x *AttestationPolicyRes) ProtoReflect() protoreflect.Message
func (*AttestationPolicyRes) Reset ¶ added in v0.5.0
func (x *AttestationPolicyRes) Reset()
func (*AttestationPolicyRes) String ¶ added in v0.5.0
func (x *AttestationPolicyRes) String() string
type CreateReq ¶ added in v0.5.0
type CreateReq struct { AgentLogLevel string `protobuf:"bytes,1,opt,name=agent_log_level,json=agentLogLevel,proto3" json:"agent_log_level,omitempty"` AgentCvmServerCaCert []byte `` /* 127-byte string literal not displayed */ AgentCvmClientKey []byte `protobuf:"bytes,3,opt,name=agent_cvm_client_key,json=agentCvmClientKey,proto3" json:"agent_cvm_client_key,omitempty"` AgentCvmClientCert []byte `protobuf:"bytes,4,opt,name=agent_cvm_client_cert,json=agentCvmClientCert,proto3" json:"agent_cvm_client_cert,omitempty"` AgentCvmServerUrl string `protobuf:"bytes,5,opt,name=agent_cvm_server_url,json=agentCvmServerUrl,proto3" json:"agent_cvm_server_url,omitempty"` // contains filtered or unexported fields }
func (*CreateReq) Descriptor
deprecated
added in
v0.5.0
func (*CreateReq) GetAgentCvmClientCert ¶ added in v0.5.0
func (*CreateReq) GetAgentCvmClientKey ¶ added in v0.5.0
func (*CreateReq) GetAgentCvmServerCaCert ¶ added in v0.5.0
func (*CreateReq) GetAgentCvmServerUrl ¶ added in v0.5.0
func (*CreateReq) GetAgentLogLevel ¶ added in v0.5.0
func (*CreateReq) ProtoMessage ¶ added in v0.5.0
func (*CreateReq) ProtoMessage()
func (*CreateReq) ProtoReflect ¶ added in v0.5.0
func (x *CreateReq) ProtoReflect() protoreflect.Message
type CreateRes ¶ added in v0.5.0
type CreateRes struct { ForwardedPort string `protobuf:"bytes,1,opt,name=forwarded_port,json=forwardedPort,proto3" json:"forwarded_port,omitempty"` SvmId string `protobuf:"bytes,2,opt,name=svm_id,json=svmId,proto3" json:"svm_id,omitempty"` // contains filtered or unexported fields }
func (*CreateRes) Descriptor
deprecated
added in
v0.5.0
func (*CreateRes) GetForwardedPort ¶ added in v0.5.0
func (*CreateRes) ProtoMessage ¶ added in v0.5.0
func (*CreateRes) ProtoMessage()
func (*CreateRes) ProtoReflect ¶ added in v0.5.0
func (x *CreateRes) ProtoReflect() protoreflect.Message
type ManagerServiceClient ¶
type ManagerServiceClient interface { CreateVm(ctx context.Context, in *CreateReq, opts ...grpc.CallOption) (*CreateRes, error) RemoveVm(ctx context.Context, in *RemoveReq, opts ...grpc.CallOption) (*emptypb.Empty, error) SVMInfo(ctx context.Context, in *SVMInfoReq, opts ...grpc.CallOption) (*SVMInfoRes, error) AttestationPolicy(ctx context.Context, in *AttestationPolicyReq, opts ...grpc.CallOption) (*AttestationPolicyRes, error) }
ManagerServiceClient is the client API for ManagerService 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 NewManagerServiceClient ¶
func NewManagerServiceClient(cc grpc.ClientConnInterface) ManagerServiceClient
type ManagerServiceServer ¶
type ManagerServiceServer interface { CreateVm(context.Context, *CreateReq) (*CreateRes, error) RemoveVm(context.Context, *RemoveReq) (*emptypb.Empty, error) SVMInfo(context.Context, *SVMInfoReq) (*SVMInfoRes, error) AttestationPolicy(context.Context, *AttestationPolicyReq) (*AttestationPolicyRes, error) // contains filtered or unexported methods }
ManagerServiceServer is the server API for ManagerService service. All implementations must embed UnimplementedManagerServiceServer for forward compatibility.
type RemoveReq ¶ added in v0.5.0
type RemoveReq struct { SvmId string `protobuf:"bytes,1,opt,name=svm_id,json=svmId,proto3" json:"svm_id,omitempty"` // contains filtered or unexported fields }
func (*RemoveReq) Descriptor
deprecated
added in
v0.5.0
func (*RemoveReq) ProtoMessage ¶ added in v0.5.0
func (*RemoveReq) ProtoMessage()
func (*RemoveReq) ProtoReflect ¶ added in v0.5.0
func (x *RemoveReq) ProtoReflect() protoreflect.Message
type SVMInfoReq ¶ added in v0.4.0
type SVMInfoReq struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*SVMInfoReq) Descriptor
deprecated
added in
v0.4.0
func (*SVMInfoReq) Descriptor() ([]byte, []int)
Deprecated: Use SVMInfoReq.ProtoReflect.Descriptor instead.
func (*SVMInfoReq) GetId ¶ added in v0.4.0
func (x *SVMInfoReq) GetId() string
func (*SVMInfoReq) ProtoMessage ¶ added in v0.4.0
func (*SVMInfoReq) ProtoMessage()
func (*SVMInfoReq) ProtoReflect ¶ added in v0.4.0
func (x *SVMInfoReq) ProtoReflect() protoreflect.Message
func (*SVMInfoReq) Reset ¶ added in v0.4.0
func (x *SVMInfoReq) Reset()
func (*SVMInfoReq) String ¶ added in v0.4.0
func (x *SVMInfoReq) String() string
type SVMInfoRes ¶ added in v0.5.0
type SVMInfoRes struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` OvmfVersion string `protobuf:"bytes,2,opt,name=ovmf_version,json=ovmfVersion,proto3" json:"ovmf_version,omitempty"` CpuNum int32 `protobuf:"varint,3,opt,name=cpu_num,json=cpuNum,proto3" json:"cpu_num,omitempty"` CpuType string `protobuf:"bytes,4,opt,name=cpu_type,json=cpuType,proto3" json:"cpu_type,omitempty"` KernelCmd string `protobuf:"bytes,5,opt,name=kernel_cmd,json=kernelCmd,proto3" json:"kernel_cmd,omitempty"` EosVersion string `protobuf:"bytes,6,opt,name=eos_version,json=eosVersion,proto3" json:"eos_version,omitempty"` // contains filtered or unexported fields }
func (*SVMInfoRes) Descriptor
deprecated
added in
v0.5.0
func (*SVMInfoRes) Descriptor() ([]byte, []int)
Deprecated: Use SVMInfoRes.ProtoReflect.Descriptor instead.
func (*SVMInfoRes) GetCpuNum ¶ added in v0.5.0
func (x *SVMInfoRes) GetCpuNum() int32
func (*SVMInfoRes) GetCpuType ¶ added in v0.5.0
func (x *SVMInfoRes) GetCpuType() string
func (*SVMInfoRes) GetEosVersion ¶ added in v0.5.0
func (x *SVMInfoRes) GetEosVersion() string
func (*SVMInfoRes) GetId ¶ added in v0.5.0
func (x *SVMInfoRes) GetId() string
func (*SVMInfoRes) GetKernelCmd ¶ added in v0.5.0
func (x *SVMInfoRes) GetKernelCmd() string
func (*SVMInfoRes) GetOvmfVersion ¶ added in v0.5.0
func (x *SVMInfoRes) GetOvmfVersion() string
func (*SVMInfoRes) ProtoMessage ¶ added in v0.5.0
func (*SVMInfoRes) ProtoMessage()
func (*SVMInfoRes) ProtoReflect ¶ added in v0.5.0
func (x *SVMInfoRes) ProtoReflect() protoreflect.Message
func (*SVMInfoRes) Reset ¶ added in v0.5.0
func (x *SVMInfoRes) Reset()
func (*SVMInfoRes) String ¶ added in v0.5.0
func (x *SVMInfoRes) String() string
type Service ¶
type Service interface { // Run create a computation. CreateVM(ctx context.Context, req *CreateReq) (string, string, error) // Stop stops a computation. RemoveVM(ctx context.Context, computationID string) error // FetchAttestationPolicy measures and fetches the attestation policy. FetchAttestationPolicy(ctx context.Context, computationID string) ([]byte, error) // ReturnSVMInfo returns SVM information needed for attestation verification and validation. ReturnSVMInfo(ctx context.Context) (string, int, string, string) }
Service specifies an API that must be fulfilled by the domain service implementation, and all of its decorators (e.g. logging & metrics).
type UnimplementedManagerServiceServer ¶
type UnimplementedManagerServiceServer struct{}
UnimplementedManagerServiceServer must 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 (UnimplementedManagerServiceServer) AttestationPolicy ¶ added in v0.5.0
func (UnimplementedManagerServiceServer) AttestationPolicy(context.Context, *AttestationPolicyReq) (*AttestationPolicyRes, error)
func (UnimplementedManagerServiceServer) SVMInfo ¶ added in v0.5.0
func (UnimplementedManagerServiceServer) SVMInfo(context.Context, *SVMInfoReq) (*SVMInfoRes, error)
type UnsafeManagerServiceServer ¶
type UnsafeManagerServiceServer interface {
// contains filtered or unexported methods
}
UnsafeManagerServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ManagerServiceServer will result in compilation errors.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
|
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations. |
grpc
Package grpc contains implementation of kit service gRPC API.
|
Package grpc contains implementation of kit service gRPC API. |
Package tracing provides tracing instrumentation for cocos auth service.
|
Package tracing provides tracing instrumentation for cocos auth service. |