diff --git a/client.go b/client.go index bb973df..b86819b 100644 --- a/client.go +++ b/client.go @@ -15,18 +15,18 @@ import ( // Queue lifecycle (create/delete/configure) is managed via the Queue CRD, not // this client — see kafaka_management_service design.md §2a/§2b. type Client struct { - conn *grpc.ClientConn - stub kafkamgmtv1.QueueServiceClient + conn *grpc.ClientConn + stub kafkamgmtv1.QueueServiceClient } // Option configures a Client during New. type Option func(*options) type options struct { - tokenSource TokenSource - tlsConfig credentials.TransportCredentials - dialTimeout time.Duration - dialOpts []grpc.DialOption + tokenSource TokenSource + tlsConfig credentials.TransportCredentials + dialTimeout time.Duration + dialOpts []grpc.DialOption } // WithTokenSource attaches a bearer token to every outgoing call via source. diff --git a/errors.go b/errors.go index 2219007..0dd7039 100644 --- a/errors.go +++ b/errors.go @@ -56,7 +56,7 @@ type sentinelError struct { } func (e *sentinelError) Error() string { return e.original.Error() } -func (e *sentinelError) Unwrap() error { return e.original } +func (e *sentinelError) Unwrap() error { return e.original } func (e *sentinelError) Is(target error) bool { return target == e.sentinel } diff --git a/examples/sendreceive/main.go b/examples/sendreceive/main.go index 7cf9e90..80daf59 100644 --- a/examples/sendreceive/main.go +++ b/examples/sendreceive/main.go @@ -42,7 +42,7 @@ func main() { msgs, err := client.ReceiveMessage(ctx, *queue, kmsvc.ReceiveOptions{ MaxNumberOfMessages: 1, - WaitTimeSeconds: 10, + WaitTimeSeconds: 10, }) if err != nil { log.Fatalf("ReceiveMessage: %v", err) diff --git a/internal_test_fake_test.go b/internal_test_fake_test.go index 80c4c41..49026a5 100644 --- a/internal_test_fake_test.go +++ b/internal_test_fake_test.go @@ -17,12 +17,12 @@ import ( type fakeQueueService struct { kafkamgmtv1.UnimplementedQueueServiceServer - sendMessage func(context.Context, *kafkamgmtv1.SendMessageRequest) (*kafkamgmtv1.SendMessageResponse, error) - sendMessageBatch func(context.Context, *kafkamgmtv1.SendMessageBatchRequest) (*kafkamgmtv1.SendMessageBatchResponse, error) - receiveMessage func(context.Context, *kafkamgmtv1.ReceiveMessageRequest) (*kafkamgmtv1.ReceiveMessageResponse, error) - deleteMessage func(context.Context, *kafkamgmtv1.DeleteMessageRequest) (*kafkamgmtv1.DeleteMessageResponse, error) - deleteMessageBatch func(context.Context, *kafkamgmtv1.DeleteMessageBatchRequest) (*kafkamgmtv1.DeleteMessageBatchResponse, error) - changeMessageVisibility func(context.Context, *kafkamgmtv1.ChangeMessageVisibilityRequest) (*kafkamgmtv1.ChangeMessageVisibilityResponse, error) + sendMessage func(context.Context, *kafkamgmtv1.SendMessageRequest) (*kafkamgmtv1.SendMessageResponse, error) + sendMessageBatch func(context.Context, *kafkamgmtv1.SendMessageBatchRequest) (*kafkamgmtv1.SendMessageBatchResponse, error) + receiveMessage func(context.Context, *kafkamgmtv1.ReceiveMessageRequest) (*kafkamgmtv1.ReceiveMessageResponse, error) + deleteMessage func(context.Context, *kafkamgmtv1.DeleteMessageRequest) (*kafkamgmtv1.DeleteMessageResponse, error) + deleteMessageBatch func(context.Context, *kafkamgmtv1.DeleteMessageBatchRequest) (*kafkamgmtv1.DeleteMessageBatchResponse, error) + changeMessageVisibility func(context.Context, *kafkamgmtv1.ChangeMessageVisibilityRequest) (*kafkamgmtv1.ChangeMessageVisibilityResponse, error) // lastIncomingAuth captures the authorization header seen by the most // recent call, for interceptor assertions. diff --git a/longpoll_test.go b/longpoll_test.go index 4210091..8f722c7 100644 --- a/longpoll_test.go +++ b/longpoll_test.go @@ -24,7 +24,7 @@ func TestReceiveMessageMapsResponse(t *testing.T) { msgs, err := client.ReceiveMessage(context.Background(), "q", ReceiveOptions{ MaxNumberOfMessages: 5, - WaitTimeSeconds: 2, + WaitTimeSeconds: 2, }) if err != nil { t.Fatalf("ReceiveMessage: %v", err) diff --git a/messages.go b/messages.go index 1c266f5..5463fd2 100644 --- a/messages.go +++ b/messages.go @@ -12,22 +12,22 @@ const MaxMessageBodyBytes = 256 * 1024 // Message is a received message, decoupled from the generated protobuf type. type Message struct { - MessageID string - ReceiptHandle string - Body []byte - Attributes map[string]string - ReceiveCount int32 - MessageGroupID string + MessageID string + ReceiptHandle string + Body []byte + Attributes map[string]string + ReceiveCount int32 + MessageGroupID string } // SendMessageInput is the input to SendMessage. type SendMessageInput struct { - QueueName string - Body []byte - Attributes map[string]string - MessageGroupID string // FIFO only - MessageDeduplicationID string // FIFO only - DelaySeconds int32 + QueueName string + Body []byte + Attributes map[string]string + MessageGroupID string // FIFO only + MessageDeduplicationID string // FIFO only + DelaySeconds int32 } // SendMessageOutput is the result of a successful SendMessage call.