client

package
v0.0.0-...-77b0776 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyRegionForContext

func AnyRegionForContext(ctx context.Context) string

AnyRegionForContext extract store region or client if not present

func CityForContext

func CityForContext(ctx context.Context) string

CityForContext extract city

func IPForContext

func IPForContext(ctx context.Context) string

IPForContext extract IP

func RegionForContext

func RegionForContext(ctx context.Context) string

RegionForContext extract region with priority over

func StoreRegionForContext

func StoreRegionForContext(ctx context.Context) string

StoreRegionForContext extract store region

func WithCity

func WithCity(ctx context.Context, city string) context.Context

WithCity build a context with a given city

func WithIP

func WithIP(ctx context.Context, ip string) context.Context

WithIP build a context with a given ip

func WithRegion

func WithRegion(ctx context.Context, region string) context.Context

WithRegion build a context with a given region

func WithStoreRegion

func WithStoreRegion(ctx context.Context, region string) context.Context

WithStoreRegion build a context with a given store region

Types

type ClientMiddleware

type ClientMiddleware func(next http.Handler) http.Handler

ClientMiddleware is a custom type for our middleware

func NewClientMiddleware

func NewClientMiddleware() ClientMiddleware

NewClientMiddleware create a ClientMiddleware

type ContextKey

type ContextKey string

ContextKey represents a context key for authentication context values

Jump to

Keyboard shortcuts

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