package
0.0.0-20220609042801-0905698132b1
Repository: https://github.com/opsdata/elmt-sdk.git
Documentation: pkg.go.dev
# Functions
AddUserAgent adds a http User-Agent header.
CopyConfig returns a copy of the given config.
DefaultServerURL - convert a host, host:port, or URL string to the default base server API path to use with a Client at a given API version following the standard conventions for an ELMT API.
DefaultUserAgent returns a User-Agent string built from static global vars.
DefaultVersionedAPIPath constructs the default path for the given group version, assuming the given API path, following the standard conventions of the ELMT API.
IsValidPathSegmentName validates the name can be safely encoded as a path segment.
IsValidPathSegmentPrefix - validate the name can be used as a prefix for a name which will be encoded as a path segment - it does not check for exact matches with disallowed names, since an arbitrary suffix might make the name valid.
LoadTLSFiles - copy the data from the CertFile, KeyFile, and CAFile fields into the CertData, KeyData, and CAFile fields, or returns an error - if no error is returned, all three fields are either populated or were empty to start.
NewRequest creates a new request helper object for accessing runtime.Objects on a server.
NewRequestWithClient creates a Request with an embedded RESTClient for use in test scenarios.
NewRESTClient - create a new RESTClient - the client performs generic REST functions such as Get, Put, Post, and Delete on specified paths.
RESTClientFor - 创建RESTClient客户端 - return a RESTClient that satisfies the requested attributes on a client Config object - a RESTClient created by this method is generic: it expects to operate on an API that follows the ELMT conventions.
SetELMTDefaults - set default values on the provided client config for accessing the ELMT API - or returns an error if any of the defaults are impossible or invalid.
TLSConfigFor - return a tls.Config that will provide the transport level security defined by the provided Config - it will return nil if no transport level security is requested.
ValidatePathSegmentName validates the name can be safely encoded as a path segment.
# Variables
NameMayNotBe specifies strings that cannot be used as names specified as path segments (like the REST API or etcd store).
NameMayNotContain specifies substrings that cannot be used in names specified as path segments (like the REST API or etcd store).
# Structs
ClientContentConfig controls how RESTClient communicates with the server.
Config holds the common attributes that can be passed to a IAM client on initialization.
ContentConfig defines config for content.
Request allows for building up a request to a server in a chained fashion.
RESTClient - impose common ELMT API conventions on a set of resource paths.
Result contains the result of calling Request.Do().
TLSClientConfig contains settings to enable transport layer security.
TLSConfig holds the information needed to set up a TLS transport.
# Interfaces
Interface captures the set of operations for generically interacting with ELMT REST apis.