package
0.0.0-20241030091535-cc1b11756418
Repository: https://github.com/onsdigital/go-ns.git
Documentation: pkg.go.dev

# Functions

AddAuthHeaders sets authentication headers for request.
AddDeprecatedHeader sets the deprecated header on the given request.
AddDownloadServiceTokenHeader sets the given download service token on the given request.
AddFlorenceHeader sets the given user access token (florence token) token on the given request.
AddRequestIdHeader add header for given correlation ID.
AddServiceTokenHeader sets the given service token on the given request.
AddUserHeader sets the given user ID on the given request.
Caller gets the caller identity from the context.
GetLangFromCookieOrDefault returns a language based on the lang cookie or if not valid defaults it.
GetLangFromSubDomain returns a language based on subdomain.
GetRequestId gets the correlation id on the context.
IsCallerPresent determines if an identity is present on the given context.
IsFlorenceIdentityPresent determines if a florence identity is present on the given context.
IsUserPresent determines if a user identity is present on the given context.
NewONSError creates a new ONS error.
NewRequestID generates a random string of requested length.
SetCaller sets the caller identity on the context.
SetFlorenceHeader sets a florence Header if the corresponding Identity key is in context.
SetFlorenceIdentity sets the florence identity for authentication.
SetLocaleCode sets the Locale code used to set the language.
SetUser sets the user identity on the context.
User gets the user identity from the context.
WithRequestId sets the correlation id on the context.

# Constants

A list of common constants used across go-ns packages.
A list of common constants used across go-ns packages.
A list of common constants used across go-ns packages.
No description provided by the author
No description provided by the author
No description provided by the author
A list of common constants used across go-ns packages.
A list of common constants used across go-ns packages.
A list of common constants used across go-ns packages.
A list of common constants used across go-ns packages.
A list of common constants used across go-ns packages.
No description provided by the author
No description provided by the author
A list of common constants used across go-ns packages.
No description provided by the author
No description provided by the author
A list of common constants used across go-ns packages.
A list of common constants used across go-ns packages.
A list of common constants used across go-ns packages.
A list of common constants used across go-ns packages.

# Variables

No description provided by the author

# Structs

IdentityResponse represents the response from the identity service.
ONSError encapsulates an error with additional parameters.

# Interfaces

CheckRequester is an interface to allow mocking of auth.CheckRequest.

# Type aliases

ContextKey is an alias of type string.
Params represents a generic map of key value pairs.