idempotencyv1

package
v1.36.11-2026011920122... Latest Latest
Warning

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

Go to latest
Published: unknown License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_fjarm_idempotency_v1_idempotency_key_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type IdempotencyKey

type IdempotencyKey struct {

	// A user-specified, unique identifier that can be used to retry eligible requests.
	IdempotencyKey *string `protobuf:"bytes,1,opt,name=idempotency_key,json=idempotencyKey,proto3,oneof" json:"idempotency_key,omitempty"`
	// A point in time independent of any time zone or calendar represented as seconds and fractions of
	// seconds at nanosecond resolution in UTC Epoch time.
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3,oneof" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

SEE: https://google.aip.dev/155 AIP-155 recommends having a `request_id` field in each request message. The value can be used to de-duplicate requests, especially those that fail due to transient or retryable errors like `UNAVAILABLE`. For retried mutation RPCs, the originally processed result can be immediately returned. This avoids expensive database operations AND ensures the same mutation returns the same result.

IdempotencyKey describes the details needed to ensure that a repeated or retried mutation RPC does is processed exactly once.

If the request fails (because of network or other retry-able errors), a client can retry a request. The server can detect duplicates and ensure the request is only processed once.

The field is added to each request body to make requirement enforcement more explicit. An interceptor then reads it and sets the value as a request header.

func (*IdempotencyKey) ClearIdempotencyKey

func (x *IdempotencyKey) ClearIdempotencyKey()

func (*IdempotencyKey) ClearTimestamp

func (x *IdempotencyKey) ClearTimestamp()

func (*IdempotencyKey) GetIdempotencyKey

func (x *IdempotencyKey) GetIdempotencyKey() string

func (*IdempotencyKey) GetTimestamp

func (x *IdempotencyKey) GetTimestamp() *timestamppb.Timestamp

func (*IdempotencyKey) HasIdempotencyKey

func (x *IdempotencyKey) HasIdempotencyKey() bool

func (*IdempotencyKey) HasTimestamp

func (x *IdempotencyKey) HasTimestamp() bool

func (*IdempotencyKey) ProtoMessage

func (*IdempotencyKey) ProtoMessage()

func (*IdempotencyKey) ProtoReflect

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

func (*IdempotencyKey) Reset

func (x *IdempotencyKey) Reset()

func (*IdempotencyKey) SetIdempotencyKey

func (x *IdempotencyKey) SetIdempotencyKey(v string)

func (*IdempotencyKey) SetTimestamp

func (x *IdempotencyKey) SetTimestamp(v *timestamppb.Timestamp)

func (*IdempotencyKey) String

func (x *IdempotencyKey) String() string

type IdempotencyKey_builder

type IdempotencyKey_builder struct {

	// A user-specified, unique identifier that can be used to retry eligible requests.
	IdempotencyKey *string
	// A point in time independent of any time zone or calendar represented as seconds and fractions of
	// seconds at nanosecond resolution in UTC Epoch time.
	Timestamp *timestamppb.Timestamp
	// contains filtered or unexported fields
}

func (IdempotencyKey_builder) Build

Source Files

  • idempotency_key.pb.go

Jump to

Keyboard shortcuts

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