Documentation ¶
Index ¶
- func CodeOf(err error) connect.Code
- func ConnectEqual[T any](x *T) *connectMatcher[T]
- func GetMsg[T any](v *connect.Request[T]) *T
- func GetResponseMsg[T any](v *connect.Response[T]) *T
- func ProtoEqual(x proto.Message) gomock.Matcher
- type Cluster
- type CreateClusterRequest
- type DeleteClusterRequest
- type Empty
- type GetClusterRequest
- type KeServiceClient
- type ListClusterRequest
- type ListClusterResponse
- type UpdateClusterRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CodeOf ¶
func CodeOf(err error) connect.Code
CodeOf returns connect.CodeOf(err) if err is not nil. Otherwise, returns 0 for OK. connect.CodeOf(err) returns codes.Unknown if err is nil, but it is not useful for testing.
func ConnectEqual ¶
func ConnectEqual[T any](x *T) *connectMatcher[T]
func GetMsg ¶
func GetMsg[T any](v *connect.Request[T]) *T
GetMsg returns v.Msg if res is not nil. Otherwise, returns nil.
Original grpc-go code implements nil check in generated code to access message field and able to get default value, but connect-go does not because connect.Request.Msg panics if it is nil.
``` var foo *T = nil foo.GetCluster() // ok
var bar connect.Request[T] = nil bar.Msg.GetCluster() // panic ```
To avoid this panic, this function is introduced.
``` var bar connect.Request[T] = nil GetMsg(bar).GetCluster() // ok ```
func GetResponseMsg ¶
func GetResponseMsg[T any](v *connect.Response[T]) *T
GetResponseMsg returns v.Msg if res is not nil. Otherwise, returns nil. See GetMsg for details.
Types ¶
type Cluster ¶
workaround for generating gomock with generics failed parsing arguments: don't know how to parse type *ast.IndexExpr
type CreateClusterRequest ¶
type CreateClusterRequest = connect.Request[v1alpha.CreateClusterRequest]
workaround for generating gomock with generics failed parsing arguments: don't know how to parse type *ast.IndexExpr
type DeleteClusterRequest ¶
type DeleteClusterRequest = connect.Request[v1alpha.DeleteClusterRequest]
workaround for generating gomock with generics failed parsing arguments: don't know how to parse type *ast.IndexExpr
type Empty ¶
workaround for generating gomock with generics failed parsing arguments: don't know how to parse type *ast.IndexExpr
type GetClusterRequest ¶
type GetClusterRequest = connect.Request[v1alpha.GetClusterRequest]
workaround for generating gomock with generics failed parsing arguments: don't know how to parse type *ast.IndexExpr
type KeServiceClient ¶
type KeServiceClient interface { CreateCluster(context.Context, *CreateClusterRequest) (*Cluster, error) GetCluster(context.Context, *GetClusterRequest) (*Cluster, error) DeleteCluster(context.Context, *DeleteClusterRequest) (*Empty, error) ListCluster(context.Context, *ListClusterRequest) (*ListClusterResponse, error) UpdateCluster(context.Context, *UpdateClusterRequest) (*Cluster, error) }
type ListClusterRequest ¶
type ListClusterRequest = connect.Request[v1alpha.ListClusterRequest]
workaround for generating gomock with generics failed parsing arguments: don't know how to parse type *ast.IndexExpr
type ListClusterResponse ¶
type ListClusterResponse = connect.Response[v1alpha.ListClusterResponse]
workaround for generating gomock with generics failed parsing arguments: don't know how to parse type *ast.IndexExpr
type UpdateClusterRequest ¶
type UpdateClusterRequest = connect.Request[v1alpha.UpdateClusterRequest]
workaround for generating gomock with generics failed parsing arguments: don't know how to parse type *ast.IndexExpr