Documentation ¶
Overview ¶
Find users with a query.
Get information for users in a paginated manner. You can optionally filter the results with a query.
Index ¶
- Variables
- type NewQueryUser
- type QueryUser
- func (r QueryUser) Do(providedCtx context.Context) (*Response, error)
- func (r *QueryUser) ErrorTrace(errortrace bool) *QueryUser
- func (r *QueryUser) FilterPath(filterpaths ...string) *QueryUser
- func (r *QueryUser) From(from int) *QueryUser
- func (r *QueryUser) Header(key, value string) *QueryUser
- func (r *QueryUser) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *QueryUser) Human(human bool) *QueryUser
- func (r QueryUser) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *QueryUser) Pretty(pretty bool) *QueryUser
- func (r *QueryUser) Query(query *types.UserQueryContainer) *QueryUser
- func (r *QueryUser) Raw(raw io.Reader) *QueryUser
- func (r *QueryUser) Request(req *Request) *QueryUser
- func (r *QueryUser) SearchAfter(sortresults ...types.FieldValue) *QueryUser
- func (r *QueryUser) Size(size int) *QueryUser
- func (r *QueryUser) Sort(sorts ...types.SortCombinations) *QueryUser
- func (r *QueryUser) WithProfileUid(withprofileuid bool) *QueryUser
- 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 NewQueryUser ¶
type NewQueryUser func() *QueryUser
NewQueryUser type alias for index.
func NewQueryUserFunc ¶
func NewQueryUserFunc(tp elastictransport.Interface) NewQueryUser
NewQueryUserFunc returns a new instance of QueryUser with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type QueryUser ¶
type QueryUser struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *QueryUser
Find users with a query.
Get information for users in a paginated manner. You can optionally filter the results with a query.
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html
func (QueryUser) Do ¶
Do runs the request through the transport, handle the response and returns a queryuser.Response
func (*QueryUser) ErrorTrace ¶
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*QueryUser) FilterPath ¶
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*QueryUser) From ¶
From Starting document offset. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the `search_after` parameter. API name: from
func (*QueryUser) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*QueryUser) Human ¶
Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human
func (QueryUser) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*QueryUser) Pretty ¶
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*QueryUser) Query ¶
func (r *QueryUser) Query(query *types.UserQueryContainer) *QueryUser
Query A query to filter which users to return. If the query parameter is missing, it is equivalent to a `match_all` query. The query supports a subset of query types, including `match_all`, `bool`, `term`, `terms`, `match`, `ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`. You can query the following information associated with user: `username`, `roles`, `enabled` API name: query
func (*QueryUser) Raw ¶
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*QueryUser) Request ¶
Request allows to set the request property with the appropriate payload.
func (*QueryUser) SearchAfter ¶
func (r *QueryUser) SearchAfter(sortresults ...types.FieldValue) *QueryUser
SearchAfter Search after definition API name: search_after
func (*QueryUser) Size ¶
Size The number of hits to return. By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters. To page through more hits, use the `search_after` parameter. API name: size
func (*QueryUser) Sort ¶
func (r *QueryUser) Sort(sorts ...types.SortCombinations) *QueryUser
Sort Fields eligible for sorting are: username, roles, enabled In addition, sort can also be applied to the `_doc` field to sort by index order. API name: sort
func (*QueryUser) WithProfileUid ¶
WithProfileUid If true will return the User Profile ID for the users in the query result, if any. API name: with_profile_uid
type Request ¶
type Request struct { // From Starting document offset. // By default, you cannot page through more than 10,000 hits using the from and // size parameters. // To page through more hits, use the `search_after` parameter. From *int `json:"from,omitempty"` // Query A query to filter which users to return. // If the query parameter is missing, it is equivalent to a `match_all` query. // The query supports a subset of query types, including `match_all`, `bool`, // `term`, `terms`, `match`, // `ids`, `prefix`, `wildcard`, `exists`, `range`, and `simple_query_string`. // You can query the following information associated with user: `username`, // `roles`, `enabled` Query *types.UserQueryContainer `json:"query,omitempty"` // SearchAfter Search after definition SearchAfter []types.FieldValue `json:"search_after,omitempty"` // Size The number of hits to return. // By default, you cannot page through more than 10,000 hits using the `from` // and `size` parameters. // To page through more hits, use the `search_after` parameter. Size *int `json:"size,omitempty"` // Sort Fields eligible for sorting are: username, roles, enabled // In addition, sort can also be applied to the `_doc` field to sort by index // order. Sort []types.SortCombinations `json:"sort,omitempty"` }
Request holds the request body struct for the package queryuser
func (*Request) UnmarshalJSON ¶
type Response ¶
type Response struct { // Count The number of users returned in the response. Count int `json:"count"` // Total The total number of users found. Total int `json:"total"` // Users A list of user information. Users []types.QueryUser `json:"users"` }
Response holds the response body struct for the package queryuser