cluster

package
v2.0.0-...-e4f2d35 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package cluster is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthCluster        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCluster          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupCluster = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterClusterServiceHandler

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

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

func RegisterClusterServiceHandlerClient

func RegisterClusterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ClusterServiceClient) error

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

func RegisterClusterServiceHandlerFromEndpoint

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

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

func RegisterClusterServiceHandlerServer

func RegisterClusterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ClusterServiceServer) error

RegisterClusterServiceHandlerServer registers the http handlers for service ClusterService to "mux". UnaryRPC :call ClusterServiceServer 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 RegisterClusterServiceHandlerFromEndpoint instead.

func RegisterClusterServiceServer

func RegisterClusterServiceServer(s *grpc.Server, srv ClusterServiceServer)

Types

type ClusterCreateRequest

type ClusterCreateRequest struct {
	Cluster              *v1alpha1.Cluster `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	Upsert               bool              `protobuf:"varint,2,opt,name=upsert,proto3" json:"upsert,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*ClusterCreateRequest) Descriptor

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

func (*ClusterCreateRequest) GetCluster

func (m *ClusterCreateRequest) GetCluster() *v1alpha1.Cluster

func (*ClusterCreateRequest) GetUpsert

func (m *ClusterCreateRequest) GetUpsert() bool

func (*ClusterCreateRequest) Marshal

func (m *ClusterCreateRequest) Marshal() (dAtA []byte, err error)

func (*ClusterCreateRequest) MarshalTo

func (m *ClusterCreateRequest) MarshalTo(dAtA []byte) (int, error)

func (*ClusterCreateRequest) MarshalToSizedBuffer

func (m *ClusterCreateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ClusterCreateRequest) ProtoMessage

func (*ClusterCreateRequest) ProtoMessage()

func (*ClusterCreateRequest) Reset

func (m *ClusterCreateRequest) Reset()

func (*ClusterCreateRequest) Size

func (m *ClusterCreateRequest) Size() (n int)

func (*ClusterCreateRequest) String

func (m *ClusterCreateRequest) String() string

func (*ClusterCreateRequest) Unmarshal

func (m *ClusterCreateRequest) Unmarshal(dAtA []byte) error

func (*ClusterCreateRequest) XXX_DiscardUnknown

func (m *ClusterCreateRequest) XXX_DiscardUnknown()

func (*ClusterCreateRequest) XXX_Marshal

func (m *ClusterCreateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ClusterCreateRequest) XXX_Merge

func (m *ClusterCreateRequest) XXX_Merge(src proto.Message)

func (*ClusterCreateRequest) XXX_Size

func (m *ClusterCreateRequest) XXX_Size() int

func (*ClusterCreateRequest) XXX_Unmarshal

func (m *ClusterCreateRequest) XXX_Unmarshal(b []byte) error

type ClusterID

type ClusterID struct {
	// type is the type of the specified cluster identifier ( "server" - default, "name" )
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	// value holds the cluster server URL or cluster name
	Value                string   `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ClusterID holds a cluster server URL or cluster name

func (*ClusterID) Descriptor

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

func (*ClusterID) GetType

func (m *ClusterID) GetType() string

func (*ClusterID) GetValue

func (m *ClusterID) GetValue() string

func (*ClusterID) Marshal

func (m *ClusterID) Marshal() (dAtA []byte, err error)

func (*ClusterID) MarshalTo

func (m *ClusterID) MarshalTo(dAtA []byte) (int, error)

func (*ClusterID) MarshalToSizedBuffer

func (m *ClusterID) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ClusterID) ProtoMessage

func (*ClusterID) ProtoMessage()

func (*ClusterID) Reset

func (m *ClusterID) Reset()

func (*ClusterID) Size

func (m *ClusterID) Size() (n int)

func (*ClusterID) String

func (m *ClusterID) String() string

func (*ClusterID) Unmarshal

func (m *ClusterID) Unmarshal(dAtA []byte) error

func (*ClusterID) XXX_DiscardUnknown

func (m *ClusterID) XXX_DiscardUnknown()

func (*ClusterID) XXX_Marshal

func (m *ClusterID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ClusterID) XXX_Merge

func (m *ClusterID) XXX_Merge(src proto.Message)

func (*ClusterID) XXX_Size

func (m *ClusterID) XXX_Size() int

func (*ClusterID) XXX_Unmarshal

func (m *ClusterID) XXX_Unmarshal(b []byte) error

type ClusterQuery

type ClusterQuery struct {
	Server               string     `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"`
	Name                 string     `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Id                   *ClusterID `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

ClusterQuery is a query for cluster resources

func (*ClusterQuery) Descriptor

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

func (*ClusterQuery) GetId

func (m *ClusterQuery) GetId() *ClusterID

func (*ClusterQuery) GetName

func (m *ClusterQuery) GetName() string

func (*ClusterQuery) GetServer

func (m *ClusterQuery) GetServer() string

func (*ClusterQuery) Marshal

func (m *ClusterQuery) Marshal() (dAtA []byte, err error)

func (*ClusterQuery) MarshalTo

func (m *ClusterQuery) MarshalTo(dAtA []byte) (int, error)

func (*ClusterQuery) MarshalToSizedBuffer

func (m *ClusterQuery) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ClusterQuery) ProtoMessage

func (*ClusterQuery) ProtoMessage()

func (*ClusterQuery) Reset

func (m *ClusterQuery) Reset()

func (*ClusterQuery) Size

func (m *ClusterQuery) Size() (n int)

func (*ClusterQuery) String

func (m *ClusterQuery) String() string

func (*ClusterQuery) Unmarshal

func (m *ClusterQuery) Unmarshal(dAtA []byte) error

func (*ClusterQuery) XXX_DiscardUnknown

func (m *ClusterQuery) XXX_DiscardUnknown()

func (*ClusterQuery) XXX_Marshal

func (m *ClusterQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ClusterQuery) XXX_Merge

func (m *ClusterQuery) XXX_Merge(src proto.Message)

func (*ClusterQuery) XXX_Size

func (m *ClusterQuery) XXX_Size() int

func (*ClusterQuery) XXX_Unmarshal

func (m *ClusterQuery) XXX_Unmarshal(b []byte) error

type ClusterResponse

type ClusterResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ClusterResponse) Descriptor

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

func (*ClusterResponse) Marshal

func (m *ClusterResponse) Marshal() (dAtA []byte, err error)

func (*ClusterResponse) MarshalTo

func (m *ClusterResponse) MarshalTo(dAtA []byte) (int, error)

func (*ClusterResponse) MarshalToSizedBuffer

func (m *ClusterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ClusterResponse) ProtoMessage

func (*ClusterResponse) ProtoMessage()

func (*ClusterResponse) Reset

func (m *ClusterResponse) Reset()

func (*ClusterResponse) Size

func (m *ClusterResponse) Size() (n int)

func (*ClusterResponse) String

func (m *ClusterResponse) String() string

func (*ClusterResponse) Unmarshal

func (m *ClusterResponse) Unmarshal(dAtA []byte) error

func (*ClusterResponse) XXX_DiscardUnknown

func (m *ClusterResponse) XXX_DiscardUnknown()

func (*ClusterResponse) XXX_Marshal

func (m *ClusterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ClusterResponse) XXX_Merge

func (m *ClusterResponse) XXX_Merge(src proto.Message)

func (*ClusterResponse) XXX_Size

func (m *ClusterResponse) XXX_Size() int

func (*ClusterResponse) XXX_Unmarshal

func (m *ClusterResponse) XXX_Unmarshal(b []byte) error

type ClusterServiceClient

type ClusterServiceClient interface {
	// List returns list of clusters
	List(ctx context.Context, in *ClusterQuery, opts ...grpc.CallOption) (*v1alpha1.ClusterList, error)
	// Create creates a cluster
	Create(ctx context.Context, in *ClusterCreateRequest, opts ...grpc.CallOption) (*v1alpha1.Cluster, error)
	// Get returns a cluster by server address
	Get(ctx context.Context, in *ClusterQuery, opts ...grpc.CallOption) (*v1alpha1.Cluster, error)
	// Update updates a cluster
	Update(ctx context.Context, in *ClusterUpdateRequest, opts ...grpc.CallOption) (*v1alpha1.Cluster, error)
	// Delete deletes a cluster
	Delete(ctx context.Context, in *ClusterQuery, opts ...grpc.CallOption) (*ClusterResponse, error)
	// RotateAuth rotates the bearer token used for a cluster
	RotateAuth(ctx context.Context, in *ClusterQuery, opts ...grpc.CallOption) (*ClusterResponse, error)
	// InvalidateCache invalidates cluster cache
	InvalidateCache(ctx context.Context, in *ClusterQuery, opts ...grpc.CallOption) (*v1alpha1.Cluster, error)
}

ClusterServiceClient is the client API for ClusterService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewClusterServiceClient

func NewClusterServiceClient(cc *grpc.ClientConn) ClusterServiceClient

type ClusterServiceServer

type ClusterServiceServer interface {
	// List returns list of clusters
	List(context.Context, *ClusterQuery) (*v1alpha1.ClusterList, error)
	// Create creates a cluster
	Create(context.Context, *ClusterCreateRequest) (*v1alpha1.Cluster, error)
	// Get returns a cluster by server address
	Get(context.Context, *ClusterQuery) (*v1alpha1.Cluster, error)
	// Update updates a cluster
	Update(context.Context, *ClusterUpdateRequest) (*v1alpha1.Cluster, error)
	// Delete deletes a cluster
	Delete(context.Context, *ClusterQuery) (*ClusterResponse, error)
	// RotateAuth rotates the bearer token used for a cluster
	RotateAuth(context.Context, *ClusterQuery) (*ClusterResponse, error)
	// InvalidateCache invalidates cluster cache
	InvalidateCache(context.Context, *ClusterQuery) (*v1alpha1.Cluster, error)
}

ClusterServiceServer is the server API for ClusterService service.

type ClusterUpdateRequest

type ClusterUpdateRequest struct {
	Cluster              *v1alpha1.Cluster `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	UpdatedFields        []string          `protobuf:"bytes,2,rep,name=updatedFields,proto3" json:"updatedFields,omitempty"`
	Id                   *ClusterID        `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*ClusterUpdateRequest) Descriptor

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

func (*ClusterUpdateRequest) GetCluster

func (m *ClusterUpdateRequest) GetCluster() *v1alpha1.Cluster

func (*ClusterUpdateRequest) GetId

func (m *ClusterUpdateRequest) GetId() *ClusterID

func (*ClusterUpdateRequest) GetUpdatedFields

func (m *ClusterUpdateRequest) GetUpdatedFields() []string

func (*ClusterUpdateRequest) Marshal

func (m *ClusterUpdateRequest) Marshal() (dAtA []byte, err error)

func (*ClusterUpdateRequest) MarshalTo

func (m *ClusterUpdateRequest) MarshalTo(dAtA []byte) (int, error)

func (*ClusterUpdateRequest) MarshalToSizedBuffer

func (m *ClusterUpdateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ClusterUpdateRequest) ProtoMessage

func (*ClusterUpdateRequest) ProtoMessage()

func (*ClusterUpdateRequest) Reset

func (m *ClusterUpdateRequest) Reset()

func (*ClusterUpdateRequest) Size

func (m *ClusterUpdateRequest) Size() (n int)

func (*ClusterUpdateRequest) String

func (m *ClusterUpdateRequest) String() string

func (*ClusterUpdateRequest) Unmarshal

func (m *ClusterUpdateRequest) Unmarshal(dAtA []byte) error

func (*ClusterUpdateRequest) XXX_DiscardUnknown

func (m *ClusterUpdateRequest) XXX_DiscardUnknown()

func (*ClusterUpdateRequest) XXX_Marshal

func (m *ClusterUpdateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ClusterUpdateRequest) XXX_Merge

func (m *ClusterUpdateRequest) XXX_Merge(src proto.Message)

func (*ClusterUpdateRequest) XXX_Size

func (m *ClusterUpdateRequest) XXX_Size() int

func (*ClusterUpdateRequest) XXX_Unmarshal

func (m *ClusterUpdateRequest) XXX_Unmarshal(b []byte) error

type UnimplementedClusterServiceServer

type UnimplementedClusterServiceServer struct {
}

UnimplementedClusterServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedClusterServiceServer) Create

func (*UnimplementedClusterServiceServer) Delete

func (*UnimplementedClusterServiceServer) Get

func (*UnimplementedClusterServiceServer) InvalidateCache

func (*UnimplementedClusterServiceServer) List

func (*UnimplementedClusterServiceServer) RotateAuth

func (*UnimplementedClusterServiceServer) Update

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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