Documentation ¶
Overview ¶
Creates a bearer token for access without requiring basic authentication.
Index ¶
- Variables
- type GetToken
- func (r GetToken) Do(ctx context.Context) (*Response, error)
- func (r *GetToken) Header(key, value string) *GetToken
- func (r *GetToken) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r GetToken) Perform(ctx context.Context) (*http.Response, error)
- func (r *GetToken) Raw(raw io.Reader) *GetToken
- func (r *GetToken) Request(req *Request) *GetToken
- type NewGetToken
- type Request
- 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 GetToken ¶
type GetToken struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *GetToken
Creates a bearer token for access without requiring basic authentication.
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html
func (GetToken) Do ¶
Do runs the request through the transport, handle the response and returns a gettoken.Response
func (*GetToken) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (GetToken) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
type NewGetToken ¶
type NewGetToken func() *GetToken
NewGetToken type alias for index.
func NewGetTokenFunc ¶
func NewGetTokenFunc(tp elastictransport.Interface) NewGetToken
NewGetTokenFunc returns a new instance of GetToken with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type Request ¶
type Request struct { GrantType *accesstokengranttype.AccessTokenGrantType `json:"grant_type,omitempty"` KerberosTicket *string `json:"kerberos_ticket,omitempty"` Password *string `json:"password,omitempty"` RefreshToken *string `json:"refresh_token,omitempty"` Scope *string `json:"scope,omitempty"` Username *string `json:"username,omitempty"` }
Request holds the request body struct for the package gettoken
type Response ¶
type Response struct { AccessToken string `json:"access_token"` Authentication types.AuthenticatedUser `json:"authentication"` ExpiresIn int64 `json:"expires_in"` KerberosAuthenticationResponseToken *string `json:"kerberos_authentication_response_token,omitempty"` RefreshToken *string `json:"refresh_token,omitempty"` Scope *string `json:"scope,omitempty"` Type string `json:"type"` }