package
0.0.0-20230628214157-3bfe64699e82
Repository: https://github.com/gravitational/gravity.git
Documentation: pkg.go.dev
# Functions
ClearSessionHeaders removes all server side cookies.
Dial dials the specified address and returns a new connection.
DialFromEnviron determines if the specified address should be resolved using local resolver prior to dialing.
DialWithLocalResolver resolves the specified address using the local resolver before dialing.
DialWithServiceResolver resolves the host as a kubernetes service using its cluster IP.
GetClient returns secure or insecure client based on settings.
GetClusterKubeClient returns a Kubernetes client that uses scheduler certificate for authentication.
GetGRPCPlanetClient a grpc client connection to the local planet agent.
No description provided by the author
GetRemoteClient returns http.Client for the remote site.
GetUnprivilegedKubeClient returns a Kubernetes client that uses kubelet certificate for authentication.
GRPCHandlerFunc returns an http.Handler that delegates to grpcHandler on incoming gRPC connections or httpHandler otherwise.
InGravity returns nil if the method was invoked inside running Gravity cluster.
InKubernetes returns true if the current context is inside a Kubernetes cluster.
LocalResolverDialer returns Dialer that uses the specified DNS server.
Message returns structured message response.
NewClient creates a new HTTP client with the specified list of configuration options.
OK returns structured OK response.
ParseAuthHeaders parses authentication headers from HTTP request it currently detects Bearer and Basic auth types.
SetGrafanaHeaders adds a cookie that holds information about current cluster.
SetupWebsocketClient sets up roundtrip client to dial web socket method.
VerifySameOrigin checks the HTTP request header values against CSRF attacks There are two steps to check: 1.
WebsocketClientForURL creates a new websocket client for the specified url using provided headers.
WithCA to use a custom certificate authority for server validation.
WithClientCert sets a certificate for mTLS client authentication.
WithDialTimeout sets dial timeout.
WithHost sets host in the Kubernetes client config.
WithIdleConnTimeout overrides the transport connection idle timeout.
WithInsecure sets insecure TLS config.
WithLocalResolver sets up client to use local DNS resolver.
WithTimeout sets timeout.
WithTLSClientConfig sets TLS client configuration.
WriteError serializes the given error into the provided response writer.
# Constants
AccessTokenQueryParam URI query parameter.
AuthBasic is username / password basic auth.
AuthBearer is bearer tokens auth.
# Variables
Methods contains all HTTP methods.
# Structs
Addr helps us to implement net.Addr interface.
AuthCreds hold authentication credentials for the given HTTP request.
WebSocketReader is a web socket handler, ignores all input and streams everything it read from reader to the web socket connection.
# Type aliases
No description provided by the author
ClientOption sets custom HTTP client option.
No description provided by the author
KubeConfigOption represents a functional argument type that allows to modify Kubernetes client configuration before creating it.