provider

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: GPL-3.0 Imports: 20 Imported by: 13

Documentation

Index

Constants

View Source
const (
	ProviderFeature_DEPLOY  = "DEPLOY"
	ProviderFeature_DESTROY = "DESTORY"
)
View Source
const VERSION = "1.0.0"

Variables

View Source
var File_provider_proto protoreflect.FileDescriptor
View Source
var Provider_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Provider",
	HandlerType: (*ProviderServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Handshake",
			Handler:    _Provider_Handshake_Handler,
		},
		{
			MethodName: "Configure",
			Handler:    _Provider_Configure_Handler,
		},
		{
			MethodName: "Deploy",
			Handler:    _Provider_Deploy_Handler,
		},
		{
			MethodName: "Destroy",
			Handler:    _Provider_Destroy_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "provider.proto",
}

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

Functions

func Connect

func Connect(options *ProviderClientOptions) (*grpc.ClientConn, error)

Connect returns a ProviderServer gRPC connection to the Provider gRPC server for use with the gRPC client

func RegisterProviderServer

func RegisterProviderServer(s grpc.ServiceRegistrar, srv ProviderServer)

func Serve

func Serve(provider ProviderServer, options *ProviderServerOptions) error

Serve is a blocking call which returns an error if unable to serve

Types

type ConfigureRequest

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

Configure

func (*ConfigureRequest) Descriptor deprecated

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

Deprecated: Use ConfigureRequest.ProtoReflect.Descriptor instead.

func (*ConfigureRequest) GetConfig

func (x *ConfigureRequest) GetConfig() []byte

func (*ConfigureRequest) ProtoMessage

func (*ConfigureRequest) ProtoMessage()

func (*ConfigureRequest) ProtoReflect

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

func (*ConfigureRequest) Reset

func (x *ConfigureRequest) Reset()

func (*ConfigureRequest) String

func (x *ConfigureRequest) String() string

type DefaultProviderServer

type DefaultProviderServer struct {
	UnimplementedProviderServer
}

func (DefaultProviderServer) Handshake

type DeployReply

type DeployReply struct {
	DeploymentId    string           `protobuf:"bytes,1,opt,name=deployment_id,json=deploymentId,proto3" json:"deployment_id,omitempty"`
	Status          common.RPCStatus `protobuf:"varint,2,opt,name=status,proto3,enum=RPCStatus" json:"status,omitempty"`
	DeploymentState *structpb.Struct `protobuf:"bytes,3,opt,name=deployment_state,json=deploymentState,proto3" json:"deployment_state,omitempty"`
	DeploymentVars  *structpb.Struct `protobuf:"bytes,4,opt,name=deployment_vars,json=deploymentVars,proto3" json:"deployment_vars,omitempty"`
	Errors          []string         `protobuf:"bytes,5,rep,name=errors,proto3" json:"errors,omitempty"`
	// contains filtered or unexported fields
}

func (*DeployReply) Descriptor deprecated

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

Deprecated: Use DeployReply.ProtoReflect.Descriptor instead.

func (*DeployReply) GetDeploymentId

func (x *DeployReply) GetDeploymentId() string

func (*DeployReply) GetDeploymentState

func (x *DeployReply) GetDeploymentState() *structpb.Struct

func (*DeployReply) GetDeploymentVars

func (x *DeployReply) GetDeploymentVars() *structpb.Struct

func (*DeployReply) GetErrors

func (x *DeployReply) GetErrors() []string

func (*DeployReply) GetStatus

func (x *DeployReply) GetStatus() common.RPCStatus

func (*DeployReply) ProtoMessage

func (*DeployReply) ProtoMessage()

func (*DeployReply) ProtoReflect

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

func (*DeployReply) Reset

func (x *DeployReply) Reset()

func (*DeployReply) String

func (x *DeployReply) String() string

type DeployRequest

type DeployRequest struct {
	DeploymentId    string           `protobuf:"bytes,1,opt,name=deployment_id,json=deploymentId,proto3" json:"deployment_id,omitempty"`
	Blueprint       []byte           `protobuf:"bytes,2,opt,name=blueprint,proto3" json:"blueprint,omitempty"`
	TemplateVars    *structpb.Struct `protobuf:"bytes,3,opt,name=templateVars,proto3" json:"templateVars,omitempty"`
	DeploymentState *structpb.Struct `protobuf:"bytes,4,opt,name=deployment_state,json=deploymentState,proto3" json:"deployment_state,omitempty"`
	DeploymentVars  *structpb.Struct `protobuf:"bytes,5,opt,name=deployment_vars,json=deploymentVars,proto3" json:"deployment_vars,omitempty"`
	// contains filtered or unexported fields
}

Deploy

func (*DeployRequest) Descriptor deprecated

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

Deprecated: Use DeployRequest.ProtoReflect.Descriptor instead.

func (*DeployRequest) GetBlueprint

func (x *DeployRequest) GetBlueprint() []byte

func (*DeployRequest) GetDeploymentId

func (x *DeployRequest) GetDeploymentId() string

func (*DeployRequest) GetDeploymentState

func (x *DeployRequest) GetDeploymentState() *structpb.Struct

func (*DeployRequest) GetDeploymentVars

func (x *DeployRequest) GetDeploymentVars() *structpb.Struct

func (*DeployRequest) GetTemplateVars

func (x *DeployRequest) GetTemplateVars() *structpb.Struct

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 DestroyReply

type DestroyReply struct {
	DeploymentId    string           `protobuf:"bytes,1,opt,name=deployment_id,json=deploymentId,proto3" json:"deployment_id,omitempty"`
	Status          common.RPCStatus `protobuf:"varint,2,opt,name=status,proto3,enum=RPCStatus" json:"status,omitempty"`
	DeploymentState *structpb.Struct `protobuf:"bytes,3,opt,name=deployment_state,json=deploymentState,proto3" json:"deployment_state,omitempty"`
	DeploymentVars  *structpb.Struct `protobuf:"bytes,4,opt,name=deployment_vars,json=deploymentVars,proto3" json:"deployment_vars,omitempty"`
	Errors          []string         `protobuf:"bytes,5,rep,name=errors,proto3" json:"errors,omitempty"`
	// contains filtered or unexported fields
}

func (*DestroyReply) Descriptor deprecated

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

Deprecated: Use DestroyReply.ProtoReflect.Descriptor instead.

func (*DestroyReply) GetDeploymentId

func (x *DestroyReply) GetDeploymentId() string

func (*DestroyReply) GetDeploymentState

func (x *DestroyReply) GetDeploymentState() *structpb.Struct

func (*DestroyReply) GetDeploymentVars

func (x *DestroyReply) GetDeploymentVars() *structpb.Struct

func (*DestroyReply) GetErrors

func (x *DestroyReply) GetErrors() []string

func (*DestroyReply) GetStatus

func (x *DestroyReply) GetStatus() common.RPCStatus

func (*DestroyReply) ProtoMessage

func (*DestroyReply) ProtoMessage()

func (*DestroyReply) ProtoReflect

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

func (*DestroyReply) Reset

func (x *DestroyReply) Reset()

func (*DestroyReply) String

func (x *DestroyReply) String() string

type DestroyRequest

type DestroyRequest struct {
	DeploymentId    string           `protobuf:"bytes,1,opt,name=deployment_id,json=deploymentId,proto3" json:"deployment_id,omitempty"`
	Blueprint       []byte           `protobuf:"bytes,2,opt,name=blueprint,proto3" json:"blueprint,omitempty"`
	TemplateVars    *structpb.Struct `protobuf:"bytes,3,opt,name=templateVars,proto3" json:"templateVars,omitempty"`
	DeploymentState *structpb.Struct `protobuf:"bytes,4,opt,name=deployment_state,json=deploymentState,proto3" json:"deployment_state,omitempty"`
	DeploymentVars  *structpb.Struct `protobuf:"bytes,5,opt,name=deployment_vars,json=deploymentVars,proto3" json:"deployment_vars,omitempty"`
	// contains filtered or unexported fields
}

Destroy

func (*DestroyRequest) Descriptor deprecated

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

Deprecated: Use DestroyRequest.ProtoReflect.Descriptor instead.

func (*DestroyRequest) GetBlueprint

func (x *DestroyRequest) GetBlueprint() []byte

func (*DestroyRequest) GetDeploymentId

func (x *DestroyRequest) GetDeploymentId() string

func (*DestroyRequest) GetDeploymentState

func (x *DestroyRequest) GetDeploymentState() *structpb.Struct

func (*DestroyRequest) GetDeploymentVars

func (x *DestroyRequest) GetDeploymentVars() *structpb.Struct

func (*DestroyRequest) GetTemplateVars

func (x *DestroyRequest) GetTemplateVars() *structpb.Struct

func (*DestroyRequest) ProtoMessage

func (*DestroyRequest) ProtoMessage()

func (*DestroyRequest) ProtoReflect

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

func (*DestroyRequest) Reset

func (x *DestroyRequest) Reset()

func (*DestroyRequest) String

func (x *DestroyRequest) String() string

type ProviderClient

type ProviderClient interface {
	Handshake(ctx context.Context, in *common.HandshakeRequest, opts ...grpc.CallOption) (*common.HandshakeReply, error)
	Configure(ctx context.Context, in *ConfigureRequest, opts ...grpc.CallOption) (*common.RPCStatusReply, error)
	Deploy(ctx context.Context, in *DeployRequest, opts ...grpc.CallOption) (*DeployReply, error)
	Destroy(ctx context.Context, in *DestroyRequest, opts ...grpc.CallOption) (*DestroyReply, error)
}

ProviderClient is the client API for Provider 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 NewProviderClient

func NewProviderClient(cc grpc.ClientConnInterface) ProviderClient

type ProviderClientOptions

type ProviderClientOptions struct {
	TLS      bool
	CAFile   string
	SocketID string
}

type ProviderServer

type ProviderServer interface {
	Handshake(context.Context, *common.HandshakeRequest) (*common.HandshakeReply, error)
	Configure(context.Context, *ConfigureRequest) (*common.RPCStatusReply, error)
	Deploy(context.Context, *DeployRequest) (*DeployReply, error)
	Destroy(context.Context, *DestroyRequest) (*DestroyReply, error)
	// contains filtered or unexported methods
}

ProviderServer is the server API for Provider service. All implementations must embed UnimplementedProviderServer for forward compatibility

type ProviderServerOptions

type ProviderServerOptions struct {
	TLS      bool
	CertFile string
	KeyFile  string
	SocketID string
}

type UnimplementedProviderServer

type UnimplementedProviderServer struct {
}

UnimplementedProviderServer must be embedded to have forward compatible implementations.

func (UnimplementedProviderServer) Configure

func (UnimplementedProviderServer) Deploy

func (UnimplementedProviderServer) Destroy

func (UnimplementedProviderServer) Handshake

type UnsafeProviderServer

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

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

Jump to

Keyboard shortcuts

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