api

package
v0.0.0-...-8b94866 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallContext

type CallContext interface {
	context.Context

	// MethodName returns the name of the method this call is directed to.
	//
	// For HTTP, this method returns the value as "<HTTP_METHOD> <URL>", e.g.,
	// GET /users/me
	//
	MethodName() string

	// RequestID returns the idempotency token, if provided in the call request.
	RequestID() *RequestID

	// RemoteAddress returns the IP address where this call was initiated
	// from. This method might return empty string if it's unable to resolve
	// the address (e.g., behind a proxy and the proxy didn't forward the
	// the origin IP).
	RemoteAddress() string
}

CallContext holds information obtained from the request. This information is generally obtained from the request's metadata (e.g., HTTP request header).

type CallInfo

type CallInfo struct {
	MethodName string
	RequestID  *RequestID
}

type CallRemoteInfo

type CallRemoteInfo struct {
	Address string
}

type RequestID

type RequestID = uuid.UUID

A RequestID in our implementation is used as idempotency token.

A good explanation of idempotency token can be viewed here: https://www.youtube.com/watch?v=IP-rGJKSZ3s

Directories

Path Synopsis
openid

Jump to

Keyboard shortcuts

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