Documentation ¶
Overview ¶
Enables authentication as a user and retrieve information about the authenticated user.
Index ¶
- Variables
- type Authenticate
- func (r Authenticate) Do(ctx context.Context) (*Response, error)
- func (r *Authenticate) Header(key, value string) *Authenticate
- func (r *Authenticate) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r Authenticate) IsSuccess(ctx context.Context) (bool, error)
- func (r Authenticate) Perform(ctx context.Context) (*http.Response, error)
- type NewAuthenticate
- type Response
Constants ¶
This section is empty.
Variables ¶
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")
ErrBuildPath is returned in case of missing parameters within the build of the request.
Functions ¶
This section is empty.
Types ¶
type Authenticate ¶
type Authenticate struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *Authenticate
Enables authentication as a user and retrieve information about the authenticated user.
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html
func (Authenticate) Do ¶
func (r Authenticate) Do(ctx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a authenticate.Response
func (*Authenticate) Header ¶
func (r *Authenticate) Header(key, value string) *Authenticate
Header set a key, value pair in the Authenticate headers map.
func (*Authenticate) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
type NewAuthenticate ¶
type NewAuthenticate func() *Authenticate
NewAuthenticate type alias for index.
func NewAuthenticateFunc ¶
func NewAuthenticateFunc(tp elastictransport.Interface) NewAuthenticate
NewAuthenticateFunc returns a new instance of Authenticate with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type Response ¶ added in v8.7.0
type Response struct { ApiKey *types.ApiKey `json:"api_key,omitempty"` AuthenticationRealm types.RealmInfo `json:"authentication_realm"` AuthenticationType string `json:"authentication_type"` Email string `json:"email,omitempty"` Enabled bool `json:"enabled"` FullName string `json:"full_name,omitempty"` LookupRealm types.RealmInfo `json:"lookup_realm"` Metadata types.Metadata `json:"metadata"` Roles []string `json:"roles"` Token *types.AuthenticateToken `json:"token,omitempty"` Username string `json:"username"` }