platform

package
v0.47.1 Latest Latest
Warning

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

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

Documentation

Overview

Package planner provides a piped component that decides the deployment pipeline of a deployment. The planner bases on the changes from git commits then builds the deployment manifests to know the behavior of the deployment. From that behavior the planner can decides which pipeline should be applied.

Index

Constants

This section is empty.

Variables

View Source
var ExecutorService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.plugin.platformapi.v1alpha1.ExecutorService",
	HandlerType: (*ExecutorServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ExecuteStage",
			Handler:       _ExecutorService_ExecuteStage_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "pkg/plugin/api/v1alpha1/platform/api.proto",
}

ExecutorService_ServiceDesc is the grpc.ServiceDesc for ExecutorService 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_pkg_plugin_api_v1alpha1_platform_api_proto protoreflect.FileDescriptor
View Source
var PlannerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.plugin.platformapi.v1alpha1.PlannerService",
	HandlerType: (*PlannerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "BuildPlan",
			Handler:    _PlannerService_BuildPlan_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pkg/plugin/api/v1alpha1/platform/api.proto",
}

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

Functions

func RegisterExecutorServiceServer

func RegisterExecutorServiceServer(s grpc.ServiceRegistrar, srv ExecutorServiceServer)

func RegisterPlannerServiceServer

func RegisterPlannerServiceServer(s grpc.ServiceRegistrar, srv PlannerServiceServer)

Types

type BuildPlanRequest

type BuildPlanRequest struct {
	WorkingDir string `protobuf:"bytes,1,opt,name=working_dir,json=workingDir,proto3" json:"working_dir,omitempty"`
	// Last successful commit hash and config file name.
	// Use to build deployment source object for last successful deployment.
	LastSuccessfulCommitHash     string `` /* 137-byte string literal not displayed */
	LastSuccessfulConfigFileName string `` /* 151-byte string literal not displayed */
	// The configuration of the piped that handles the deployment.
	PipedConfig []byte `protobuf:"bytes,4,opt,name=piped_config,json=pipedConfig,proto3" json:"piped_config,omitempty"`
	// The deployment to build a plan for.
	Deployment *model.Deployment `protobuf:"bytes,5,opt,name=deployment,proto3" json:"deployment,omitempty"`
	// contains filtered or unexported fields
}

func (*BuildPlanRequest) Descriptor deprecated

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

Deprecated: Use BuildPlanRequest.ProtoReflect.Descriptor instead.

func (*BuildPlanRequest) GetDeployment

func (x *BuildPlanRequest) GetDeployment() *model.Deployment

func (*BuildPlanRequest) GetLastSuccessfulCommitHash

func (x *BuildPlanRequest) GetLastSuccessfulCommitHash() string

func (*BuildPlanRequest) GetLastSuccessfulConfigFileName

func (x *BuildPlanRequest) GetLastSuccessfulConfigFileName() string

func (*BuildPlanRequest) GetPipedConfig

func (x *BuildPlanRequest) GetPipedConfig() []byte

func (*BuildPlanRequest) GetWorkingDir

func (x *BuildPlanRequest) GetWorkingDir() string

func (*BuildPlanRequest) ProtoMessage

func (*BuildPlanRequest) ProtoMessage()

func (*BuildPlanRequest) ProtoReflect

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

func (*BuildPlanRequest) Reset

func (x *BuildPlanRequest) Reset()

func (*BuildPlanRequest) String

func (x *BuildPlanRequest) String() string

func (*BuildPlanRequest) Validate

func (m *BuildPlanRequest) Validate() error

Validate checks the field values on BuildPlanRequest 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 (*BuildPlanRequest) ValidateAll

func (m *BuildPlanRequest) ValidateAll() error

ValidateAll checks the field values on BuildPlanRequest 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 BuildPlanRequestMultiError, or nil if none found.

type BuildPlanRequestMultiError

type BuildPlanRequestMultiError []error

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

func (BuildPlanRequestMultiError) AllErrors

func (m BuildPlanRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (BuildPlanRequestMultiError) Error

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

type BuildPlanRequestValidationError

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

BuildPlanRequestValidationError is the validation error returned by BuildPlanRequest.Validate if the designated constraints aren't met.

func (BuildPlanRequestValidationError) Cause

Cause function returns cause value.

func (BuildPlanRequestValidationError) Error

Error satisfies the builtin error interface

func (BuildPlanRequestValidationError) ErrorName

ErrorName returns error name.

func (BuildPlanRequestValidationError) Field

Field function returns field value.

func (BuildPlanRequestValidationError) Key

Key function returns key value.

func (BuildPlanRequestValidationError) Reason

Reason function returns reason value.

type BuildPlanResponse

type BuildPlanResponse struct {

	// The built deployment plan.
	Plan *DeploymentPlan `protobuf:"bytes,1,opt,name=plan,proto3" json:"plan,omitempty"`
	// contains filtered or unexported fields
}

func (*BuildPlanResponse) Descriptor deprecated

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

Deprecated: Use BuildPlanResponse.ProtoReflect.Descriptor instead.

func (*BuildPlanResponse) GetPlan

func (x *BuildPlanResponse) GetPlan() *DeploymentPlan

func (*BuildPlanResponse) ProtoMessage

func (*BuildPlanResponse) ProtoMessage()

func (*BuildPlanResponse) ProtoReflect

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

func (*BuildPlanResponse) Reset

func (x *BuildPlanResponse) Reset()

func (*BuildPlanResponse) String

func (x *BuildPlanResponse) String() string

func (*BuildPlanResponse) Validate

func (m *BuildPlanResponse) Validate() error

Validate checks the field values on BuildPlanResponse 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 (*BuildPlanResponse) ValidateAll

func (m *BuildPlanResponse) ValidateAll() error

ValidateAll checks the field values on BuildPlanResponse 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 BuildPlanResponseMultiError, or nil if none found.

type BuildPlanResponseMultiError

type BuildPlanResponseMultiError []error

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

func (BuildPlanResponseMultiError) AllErrors

func (m BuildPlanResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (BuildPlanResponseMultiError) Error

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

type BuildPlanResponseValidationError

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

BuildPlanResponseValidationError is the validation error returned by BuildPlanResponse.Validate if the designated constraints aren't met.

func (BuildPlanResponseValidationError) Cause

Cause function returns cause value.

func (BuildPlanResponseValidationError) Error

Error satisfies the builtin error interface

func (BuildPlanResponseValidationError) ErrorName

ErrorName returns error name.

func (BuildPlanResponseValidationError) Field

Field function returns field value.

func (BuildPlanResponseValidationError) Key

Key function returns key value.

func (BuildPlanResponseValidationError) Reason

Reason function returns reason value.

type DeploymentPlan

type DeploymentPlan struct {
	SyncStrategy model.SyncStrategy `protobuf:"varint,1,opt,name=sync_strategy,json=syncStrategy,proto3,enum=model.SyncStrategy" json:"sync_strategy,omitempty"`
	// Text summary of planned deployment.
	Summary  string                   `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"`
	Versions []*model.ArtifactVersion `protobuf:"bytes,3,rep,name=versions,proto3" json:"versions,omitempty"`
	Stages   []*model.PipelineStage   `protobuf:"bytes,4,rep,name=stages,proto3" json:"stages,omitempty"`
	// contains filtered or unexported fields
}

func (*DeploymentPlan) Descriptor deprecated

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

Deprecated: Use DeploymentPlan.ProtoReflect.Descriptor instead.

func (*DeploymentPlan) GetStages

func (x *DeploymentPlan) GetStages() []*model.PipelineStage

func (*DeploymentPlan) GetSummary

func (x *DeploymentPlan) GetSummary() string

func (*DeploymentPlan) GetSyncStrategy

func (x *DeploymentPlan) GetSyncStrategy() model.SyncStrategy

func (*DeploymentPlan) GetVersions

func (x *DeploymentPlan) GetVersions() []*model.ArtifactVersion

func (*DeploymentPlan) ProtoMessage

func (*DeploymentPlan) ProtoMessage()

func (*DeploymentPlan) ProtoReflect

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

func (*DeploymentPlan) Reset

func (x *DeploymentPlan) Reset()

func (*DeploymentPlan) String

func (x *DeploymentPlan) String() string

func (*DeploymentPlan) Validate

func (m *DeploymentPlan) Validate() error

Validate checks the field values on DeploymentPlan 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 (*DeploymentPlan) ValidateAll

func (m *DeploymentPlan) ValidateAll() error

ValidateAll checks the field values on DeploymentPlan 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 DeploymentPlanMultiError, or nil if none found.

type DeploymentPlanMultiError

type DeploymentPlanMultiError []error

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

func (DeploymentPlanMultiError) AllErrors

func (m DeploymentPlanMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DeploymentPlanMultiError) Error

func (m DeploymentPlanMultiError) Error() string

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

type DeploymentPlanValidationError

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

DeploymentPlanValidationError is the validation error returned by DeploymentPlan.Validate if the designated constraints aren't met.

func (DeploymentPlanValidationError) Cause

Cause function returns cause value.

func (DeploymentPlanValidationError) Error

Error satisfies the builtin error interface

func (DeploymentPlanValidationError) ErrorName

func (e DeploymentPlanValidationError) ErrorName() string

ErrorName returns error name.

func (DeploymentPlanValidationError) Field

Field function returns field value.

func (DeploymentPlanValidationError) Key

Key function returns key value.

func (DeploymentPlanValidationError) Reason

Reason function returns reason value.

type ExecuteStageRequest

type ExecuteStageRequest struct {
	Stage       *model.PipelineStage `protobuf:"bytes,1,opt,name=stage,proto3" json:"stage,omitempty"`
	StageConfig []byte               `protobuf:"bytes,2,opt,name=stage_config,json=stageConfig,proto3" json:"stage_config,omitempty"`
	PipedConfig []byte               `protobuf:"bytes,3,opt,name=piped_config,json=pipedConfig,proto3" json:"piped_config,omitempty"`
	Deployment  *model.Deployment    `protobuf:"bytes,4,opt,name=deployment,proto3" json:"deployment,omitempty"`
	// contains filtered or unexported fields
}

func (*ExecuteStageRequest) Descriptor deprecated

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

Deprecated: Use ExecuteStageRequest.ProtoReflect.Descriptor instead.

func (*ExecuteStageRequest) GetDeployment

func (x *ExecuteStageRequest) GetDeployment() *model.Deployment

func (*ExecuteStageRequest) GetPipedConfig

func (x *ExecuteStageRequest) GetPipedConfig() []byte

func (*ExecuteStageRequest) GetStage

func (x *ExecuteStageRequest) GetStage() *model.PipelineStage

func (*ExecuteStageRequest) GetStageConfig

func (x *ExecuteStageRequest) GetStageConfig() []byte

func (*ExecuteStageRequest) ProtoMessage

func (*ExecuteStageRequest) ProtoMessage()

func (*ExecuteStageRequest) ProtoReflect

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

func (*ExecuteStageRequest) Reset

func (x *ExecuteStageRequest) Reset()

func (*ExecuteStageRequest) String

func (x *ExecuteStageRequest) String() string

func (*ExecuteStageRequest) Validate

func (m *ExecuteStageRequest) Validate() error

Validate checks the field values on ExecuteStageRequest 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 (*ExecuteStageRequest) ValidateAll

func (m *ExecuteStageRequest) ValidateAll() error

ValidateAll checks the field values on ExecuteStageRequest 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 ExecuteStageRequestMultiError, or nil if none found.

type ExecuteStageRequestMultiError

type ExecuteStageRequestMultiError []error

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

func (ExecuteStageRequestMultiError) AllErrors

func (m ExecuteStageRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ExecuteStageRequestMultiError) Error

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

type ExecuteStageRequestValidationError

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

ExecuteStageRequestValidationError is the validation error returned by ExecuteStageRequest.Validate if the designated constraints aren't met.

func (ExecuteStageRequestValidationError) Cause

Cause function returns cause value.

func (ExecuteStageRequestValidationError) Error

Error satisfies the builtin error interface

func (ExecuteStageRequestValidationError) ErrorName

ErrorName returns error name.

func (ExecuteStageRequestValidationError) Field

Field function returns field value.

func (ExecuteStageRequestValidationError) Key

Key function returns key value.

func (ExecuteStageRequestValidationError) Reason

Reason function returns reason value.

type ExecuteStageResponse

type ExecuteStageResponse struct {
	Status model.StageStatus `protobuf:"varint,1,opt,name=status,proto3,enum=model.StageStatus" json:"status,omitempty"`
	Log    string            `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"`
	// contains filtered or unexported fields
}

func (*ExecuteStageResponse) Descriptor deprecated

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

Deprecated: Use ExecuteStageResponse.ProtoReflect.Descriptor instead.

func (*ExecuteStageResponse) GetLog

func (x *ExecuteStageResponse) GetLog() string

func (*ExecuteStageResponse) GetStatus

func (x *ExecuteStageResponse) GetStatus() model.StageStatus

func (*ExecuteStageResponse) ProtoMessage

func (*ExecuteStageResponse) ProtoMessage()

func (*ExecuteStageResponse) ProtoReflect

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

func (*ExecuteStageResponse) Reset

func (x *ExecuteStageResponse) Reset()

func (*ExecuteStageResponse) String

func (x *ExecuteStageResponse) String() string

func (*ExecuteStageResponse) Validate

func (m *ExecuteStageResponse) Validate() error

Validate checks the field values on ExecuteStageResponse 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 (*ExecuteStageResponse) ValidateAll

func (m *ExecuteStageResponse) ValidateAll() error

ValidateAll checks the field values on ExecuteStageResponse 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 ExecuteStageResponseMultiError, or nil if none found.

type ExecuteStageResponseMultiError

type ExecuteStageResponseMultiError []error

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

func (ExecuteStageResponseMultiError) AllErrors

func (m ExecuteStageResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ExecuteStageResponseMultiError) Error

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

type ExecuteStageResponseValidationError

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

ExecuteStageResponseValidationError is the validation error returned by ExecuteStageResponse.Validate if the designated constraints aren't met.

func (ExecuteStageResponseValidationError) Cause

Cause function returns cause value.

func (ExecuteStageResponseValidationError) Error

Error satisfies the builtin error interface

func (ExecuteStageResponseValidationError) ErrorName

ErrorName returns error name.

func (ExecuteStageResponseValidationError) Field

Field function returns field value.

func (ExecuteStageResponseValidationError) Key

Key function returns key value.

func (ExecuteStageResponseValidationError) Reason

Reason function returns reason value.

type ExecutorServiceClient

type ExecutorServiceClient interface {
	// Execute executes the given stage of the deployment plan.
	ExecuteStage(ctx context.Context, in *ExecuteStageRequest, opts ...grpc.CallOption) (ExecutorService_ExecuteStageClient, error)
}

ExecutorServiceClient is the client API for ExecutorService 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 ExecutorServiceServer

type ExecutorServiceServer interface {
	// Execute executes the given stage of the deployment plan.
	ExecuteStage(*ExecuteStageRequest, ExecutorService_ExecuteStageServer) error
	// contains filtered or unexported methods
}

ExecutorServiceServer is the server API for ExecutorService service. All implementations must embed UnimplementedExecutorServiceServer for forward compatibility

type ExecutorService_ExecuteStageClient

type ExecutorService_ExecuteStageClient interface {
	Recv() (*ExecuteStageResponse, error)
	grpc.ClientStream
}

type ExecutorService_ExecuteStageServer

type ExecutorService_ExecuteStageServer interface {
	Send(*ExecuteStageResponse) error
	grpc.ServerStream
}

type PlannerServiceClient

type PlannerServiceClient interface {
	// BuildPlan builds plan for the given deployment.
	BuildPlan(ctx context.Context, in *BuildPlanRequest, opts ...grpc.CallOption) (*BuildPlanResponse, error)
}

PlannerServiceClient is the client API for PlannerService 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 PlannerServiceServer

type PlannerServiceServer interface {
	// BuildPlan builds plan for the given deployment.
	BuildPlan(context.Context, *BuildPlanRequest) (*BuildPlanResponse, error)
	// contains filtered or unexported methods
}

PlannerServiceServer is the server API for PlannerService service. All implementations must embed UnimplementedPlannerServiceServer for forward compatibility

type PlatformPluginClient

type PlatformPluginClient interface {
	PlannerServiceClient
	ExecutorServiceClient
	Close() error
}

func NewClient

func NewClient(ctx context.Context, address string, opts ...rpcclient.DialOption) (PlatformPluginClient, error)

type UnimplementedExecutorServiceServer

type UnimplementedExecutorServiceServer struct {
}

UnimplementedExecutorServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedExecutorServiceServer) ExecuteStage

type UnimplementedPlannerServiceServer

type UnimplementedPlannerServiceServer struct {
}

UnimplementedPlannerServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedPlannerServiceServer) BuildPlan

type UnsafeExecutorServiceServer

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

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

type UnsafePlannerServiceServer

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

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

Jump to

Keyboard shortcuts

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