Documentation ¶
Overview ¶
Package cluster is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterClusterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterClusterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ClusterServiceClient) error
- func RegisterClusterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterClusterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ClusterServiceServer) error
- func RegisterClusterServiceServer(s grpc.ServiceRegistrar, srv ClusterServiceServer)
- type Cluster
- func (*Cluster) Descriptor() ([]byte, []int)deprecated
- func (x *Cluster) GetCreatedAt() *timestamppb.Timestamp
- func (x *Cluster) GetId() string
- func (x *Cluster) GetIdc() string
- func (x *Cluster) GetIntro() string
- func (x *Cluster) GetKubeconfig() string
- func (x *Cluster) GetName() string
- func (x *Cluster) GetTags() []string
- func (x *Cluster) GetUpdatedAt() *timestamppb.Timestamp
- func (*Cluster) ProtoMessage()
- func (x *Cluster) ProtoReflect() protoreflect.Message
- func (x *Cluster) Reset()
- func (x *Cluster) String() string
- func (m *Cluster) Validate() error
- func (m *Cluster) ValidateAll() error
- type ClusterMultiError
- type ClusterServiceClient
- type ClusterServiceServer
- type ClusterValidationError
- type ListRequest
- func (*ListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListRequest) GetAppid() string
- func (*ListRequest) ProtoMessage()
- func (x *ListRequest) ProtoReflect() protoreflect.Message
- func (x *ListRequest) Reset()
- func (x *ListRequest) String() string
- func (m *ListRequest) Validate() error
- func (m *ListRequest) ValidateAll() error
- type ListRequestMultiError
- type ListRequestValidationError
- func (e ListRequestValidationError) Cause() error
- func (e ListRequestValidationError) Error() string
- func (e ListRequestValidationError) ErrorName() string
- func (e ListRequestValidationError) Field() string
- func (e ListRequestValidationError) Key() bool
- func (e ListRequestValidationError) Reason() string
- type ListResponse
- func (*ListResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListResponse) GetItems() []*Cluster
- func (x *ListResponse) GetTotal() int64
- func (*ListResponse) ProtoMessage()
- func (x *ListResponse) ProtoReflect() protoreflect.Message
- func (x *ListResponse) Reset()
- func (x *ListResponse) String() string
- func (m *ListResponse) Validate() error
- func (m *ListResponse) ValidateAll() error
- type ListResponseMultiError
- type ListResponseValidationError
- func (e ListResponseValidationError) Cause() error
- func (e ListResponseValidationError) Error() string
- func (e ListResponseValidationError) ErrorName() string
- func (e ListResponseValidationError) Field() string
- func (e ListResponseValidationError) Key() bool
- func (e ListResponseValidationError) Reason() string
- type UnimplementedClusterServiceServer
- func (UnimplementedClusterServiceServer) Create(context.Context, *Cluster) (*Cluster, error)
- func (UnimplementedClusterServiceServer) Delete(context.Context, *kiae.IdRequest) (*emptypb.Empty, error)
- func (UnimplementedClusterServiceServer) List(context.Context, *ListRequest) (*ListResponse, error)
- func (UnimplementedClusterServiceServer) Update(context.Context, *UpdateRequest) (*Cluster, error)
- type UnsafeClusterServiceServer
- type UpdateRequest
- func (*UpdateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateRequest) GetPayload() *Cluster
- func (x *UpdateRequest) GetUpdateMask() *fieldmaskpb.FieldMask
- func (*UpdateRequest) ProtoMessage()
- func (x *UpdateRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateRequest) Reset()
- func (x *UpdateRequest) String() string
- func (m *UpdateRequest) Validate() error
- func (m *UpdateRequest) ValidateAll() error
- type UpdateRequestMultiError
- type UpdateRequestValidationError
- func (e UpdateRequestValidationError) Cause() error
- func (e UpdateRequestValidationError) Error() string
- func (e UpdateRequestValidationError) ErrorName() string
- func (e UpdateRequestValidationError) Field() string
- func (e UpdateRequestValidationError) Key() bool
- func (e UpdateRequestValidationError) Reason() string
Constants ¶
This section is empty.
Variables ¶
var ClusterService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "cluster.ClusterService", HandlerType: (*ClusterServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "List", Handler: _ClusterService_List_Handler, }, { MethodName: "Create", Handler: _ClusterService_Create_Handler, }, { MethodName: "Update", Handler: _ClusterService_Update_Handler, }, { MethodName: "Delete", Handler: _ClusterService_Delete_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "cluster/cluster.proto", }
ClusterService_ServiceDesc is the grpc.ServiceDesc for ClusterService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_cluster_cluster_proto protoreflect.FileDescriptor
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.ServiceRegistrar, srv ClusterServiceServer)
Types ¶
type Cluster ¶
type Cluster struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" bson:"_id,omitempty"` // @gotags: bson:"_id,omitempty" Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Intro string `protobuf:"bytes,3,opt,name=intro,proto3" json:"intro,omitempty"` Idc string `protobuf:"bytes,6,opt,name=idc,proto3" json:"idc,omitempty"` Tags []string `protobuf:"bytes,7,rep,name=tags,proto3" json:"tags,omitempty"` Kubeconfig string `protobuf:"bytes,8,opt,name=kubeconfig,proto3" json:"kubeconfig,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,101,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,103,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // contains filtered or unexported fields }
func (*Cluster) Descriptor
deprecated
func (*Cluster) GetCreatedAt ¶
func (x *Cluster) GetCreatedAt() *timestamppb.Timestamp
func (*Cluster) GetKubeconfig ¶
func (*Cluster) GetUpdatedAt ¶
func (x *Cluster) GetUpdatedAt() *timestamppb.Timestamp
func (*Cluster) ProtoMessage ¶
func (*Cluster) ProtoMessage()
func (*Cluster) ProtoReflect ¶
func (x *Cluster) ProtoReflect() protoreflect.Message
func (*Cluster) Validate ¶
Validate checks the field values on Cluster 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 (*Cluster) ValidateAll ¶
ValidateAll checks the field values on Cluster 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 ClusterMultiError, or nil if none found.
type ClusterMultiError ¶
type ClusterMultiError []error
ClusterMultiError is an error wrapping multiple validation errors returned by Cluster.ValidateAll() if the designated constraints aren't met.
func (ClusterMultiError) AllErrors ¶
func (m ClusterMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ClusterMultiError) Error ¶
func (m ClusterMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ClusterServiceClient ¶
type ClusterServiceClient interface { List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) Create(ctx context.Context, in *Cluster, opts ...grpc.CallOption) (*Cluster, error) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*Cluster, error) Delete(ctx context.Context, in *kiae.IdRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) }
ClusterServiceClient is the client API for ClusterService 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 NewClusterServiceClient ¶
func NewClusterServiceClient(cc grpc.ClientConnInterface) ClusterServiceClient
type ClusterServiceServer ¶
type ClusterServiceServer interface { List(context.Context, *ListRequest) (*ListResponse, error) Create(context.Context, *Cluster) (*Cluster, error) Update(context.Context, *UpdateRequest) (*Cluster, error) Delete(context.Context, *kiae.IdRequest) (*emptypb.Empty, error) }
ClusterServiceServer is the server API for ClusterService service. All implementations should embed UnimplementedClusterServiceServer for forward compatibility
type ClusterValidationError ¶
type ClusterValidationError struct {
// contains filtered or unexported fields
}
ClusterValidationError is the validation error returned by Cluster.Validate if the designated constraints aren't met.
func (ClusterValidationError) Cause ¶
func (e ClusterValidationError) Cause() error
Cause function returns cause value.
func (ClusterValidationError) Error ¶
func (e ClusterValidationError) Error() string
Error satisfies the builtin error interface
func (ClusterValidationError) ErrorName ¶
func (e ClusterValidationError) ErrorName() string
ErrorName returns error name.
func (ClusterValidationError) Field ¶
func (e ClusterValidationError) Field() string
Field function returns field value.
func (ClusterValidationError) Key ¶
func (e ClusterValidationError) Key() bool
Key function returns key value.
func (ClusterValidationError) Reason ¶
func (e ClusterValidationError) Reason() string
Reason function returns reason value.
type ListRequest ¶
type ListRequest struct { Appid string `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"` // contains filtered or unexported fields }
func (*ListRequest) Descriptor
deprecated
func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) GetAppid ¶
func (x *ListRequest) GetAppid() string
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
func (*ListRequest) Validate ¶
func (m *ListRequest) Validate() error
Validate checks the field values on ListRequest 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 (*ListRequest) ValidateAll ¶
func (m *ListRequest) ValidateAll() error
ValidateAll checks the field values on ListRequest 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 ListRequestMultiError, or nil if none found.
type ListRequestMultiError ¶
type ListRequestMultiError []error
ListRequestMultiError is an error wrapping multiple validation errors returned by ListRequest.ValidateAll() if the designated constraints aren't met.
func (ListRequestMultiError) AllErrors ¶
func (m ListRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ListRequestMultiError) Error ¶
func (m ListRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ListRequestValidationError ¶
type ListRequestValidationError struct {
// contains filtered or unexported fields
}
ListRequestValidationError is the validation error returned by ListRequest.Validate if the designated constraints aren't met.
func (ListRequestValidationError) Cause ¶
func (e ListRequestValidationError) Cause() error
Cause function returns cause value.
func (ListRequestValidationError) Error ¶
func (e ListRequestValidationError) Error() string
Error satisfies the builtin error interface
func (ListRequestValidationError) ErrorName ¶
func (e ListRequestValidationError) ErrorName() string
ErrorName returns error name.
func (ListRequestValidationError) Field ¶
func (e ListRequestValidationError) Field() string
Field function returns field value.
func (ListRequestValidationError) Key ¶
func (e ListRequestValidationError) Key() bool
Key function returns key value.
func (ListRequestValidationError) Reason ¶
func (e ListRequestValidationError) Reason() string
Reason function returns reason value.
type ListResponse ¶
type ListResponse struct { Items []*Cluster `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` // contains filtered or unexported fields }
func (*ListResponse) Descriptor
deprecated
func (*ListResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.
func (*ListResponse) GetItems ¶
func (x *ListResponse) GetItems() []*Cluster
func (*ListResponse) GetTotal ¶
func (x *ListResponse) GetTotal() int64
func (*ListResponse) ProtoMessage ¶
func (*ListResponse) ProtoMessage()
func (*ListResponse) ProtoReflect ¶
func (x *ListResponse) ProtoReflect() protoreflect.Message
func (*ListResponse) Reset ¶
func (x *ListResponse) Reset()
func (*ListResponse) String ¶
func (x *ListResponse) String() string
func (*ListResponse) Validate ¶
func (m *ListResponse) Validate() error
Validate checks the field values on ListResponse 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 (*ListResponse) ValidateAll ¶
func (m *ListResponse) ValidateAll() error
ValidateAll checks the field values on ListResponse 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 ListResponseMultiError, or nil if none found.
type ListResponseMultiError ¶
type ListResponseMultiError []error
ListResponseMultiError is an error wrapping multiple validation errors returned by ListResponse.ValidateAll() if the designated constraints aren't met.
func (ListResponseMultiError) AllErrors ¶
func (m ListResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ListResponseMultiError) Error ¶
func (m ListResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ListResponseValidationError ¶
type ListResponseValidationError struct {
// contains filtered or unexported fields
}
ListResponseValidationError is the validation error returned by ListResponse.Validate if the designated constraints aren't met.
func (ListResponseValidationError) Cause ¶
func (e ListResponseValidationError) Cause() error
Cause function returns cause value.
func (ListResponseValidationError) Error ¶
func (e ListResponseValidationError) Error() string
Error satisfies the builtin error interface
func (ListResponseValidationError) ErrorName ¶
func (e ListResponseValidationError) ErrorName() string
ErrorName returns error name.
func (ListResponseValidationError) Field ¶
func (e ListResponseValidationError) Field() string
Field function returns field value.
func (ListResponseValidationError) Key ¶
func (e ListResponseValidationError) Key() bool
Key function returns key value.
func (ListResponseValidationError) Reason ¶
func (e ListResponseValidationError) Reason() string
Reason function returns reason value.
type UnimplementedClusterServiceServer ¶
type UnimplementedClusterServiceServer struct { }
UnimplementedClusterServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedClusterServiceServer) List ¶
func (UnimplementedClusterServiceServer) List(context.Context, *ListRequest) (*ListResponse, error)
func (UnimplementedClusterServiceServer) Update ¶
func (UnimplementedClusterServiceServer) Update(context.Context, *UpdateRequest) (*Cluster, error)
type UnsafeClusterServiceServer ¶
type UnsafeClusterServiceServer interface {
// contains filtered or unexported methods
}
UnsafeClusterServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ClusterServiceServer will result in compilation errors.
type UpdateRequest ¶
type UpdateRequest struct { Payload *Cluster `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` // contains filtered or unexported fields }
func (*UpdateRequest) Descriptor
deprecated
func (*UpdateRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.
func (*UpdateRequest) GetPayload ¶
func (x *UpdateRequest) GetPayload() *Cluster
func (*UpdateRequest) GetUpdateMask ¶
func (x *UpdateRequest) GetUpdateMask() *fieldmaskpb.FieldMask
func (*UpdateRequest) ProtoMessage ¶
func (*UpdateRequest) ProtoMessage()
func (*UpdateRequest) ProtoReflect ¶
func (x *UpdateRequest) ProtoReflect() protoreflect.Message
func (*UpdateRequest) Reset ¶
func (x *UpdateRequest) Reset()
func (*UpdateRequest) String ¶
func (x *UpdateRequest) String() string
func (*UpdateRequest) Validate ¶
func (m *UpdateRequest) Validate() error
Validate checks the field values on UpdateRequest 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 (*UpdateRequest) ValidateAll ¶
func (m *UpdateRequest) ValidateAll() error
ValidateAll checks the field values on UpdateRequest 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 UpdateRequestMultiError, or nil if none found.
type UpdateRequestMultiError ¶
type UpdateRequestMultiError []error
UpdateRequestMultiError is an error wrapping multiple validation errors returned by UpdateRequest.ValidateAll() if the designated constraints aren't met.
func (UpdateRequestMultiError) AllErrors ¶
func (m UpdateRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UpdateRequestMultiError) Error ¶
func (m UpdateRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UpdateRequestValidationError ¶
type UpdateRequestValidationError struct {
// contains filtered or unexported fields
}
UpdateRequestValidationError is the validation error returned by UpdateRequest.Validate if the designated constraints aren't met.
func (UpdateRequestValidationError) Cause ¶
func (e UpdateRequestValidationError) Cause() error
Cause function returns cause value.
func (UpdateRequestValidationError) Error ¶
func (e UpdateRequestValidationError) Error() string
Error satisfies the builtin error interface
func (UpdateRequestValidationError) ErrorName ¶
func (e UpdateRequestValidationError) ErrorName() string
ErrorName returns error name.
func (UpdateRequestValidationError) Field ¶
func (e UpdateRequestValidationError) Field() string
Field function returns field value.
func (UpdateRequestValidationError) Key ¶
func (e UpdateRequestValidationError) Key() bool
Key function returns key value.
func (UpdateRequestValidationError) Reason ¶
func (e UpdateRequestValidationError) Reason() string
Reason function returns reason value.