queryuser

package
v8.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

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

Constants

This section is empty.

Variables

View Source
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

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

func (r QueryUser) Do(providedCtx context.Context) (*Response, error)

Do runs the request through the transport, handle the response and returns a queryuser.Response

func (*QueryUser) ErrorTrace

func (r *QueryUser) ErrorTrace(errortrace bool) *QueryUser

ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace

func (*QueryUser) FilterPath

func (r *QueryUser) FilterPath(filterpaths ...string) *QueryUser

FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path

func (*QueryUser) From

func (r *QueryUser) From(from int) *QueryUser

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) Header

func (r *QueryUser) Header(key, value string) *QueryUser

Header set a key, value pair in the QueryUser headers map.

func (*QueryUser) HttpRequest

func (r *QueryUser) HttpRequest(ctx context.Context) (*http.Request, error)

HttpRequest returns the http.Request object built from the given parameters.

func (*QueryUser) Human

func (r *QueryUser) Human(human bool) *QueryUser

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

func (r QueryUser) Perform(providedCtx context.Context) (*http.Response, error)

Perform runs the http.Request through the provided transport and returns an http.Response.

func (*QueryUser) Pretty

func (r *QueryUser) Pretty(pretty bool) *QueryUser

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

func (r *QueryUser) Raw(raw io.Reader) *QueryUser

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

func (r *QueryUser) Request(req *Request) *QueryUser

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

func (r *QueryUser) Size(size int) *QueryUser

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

func (r *QueryUser) WithProfileUid(withprofileuid bool) *QueryUser

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

https://github.com/elastic/elasticsearch-specification/blob/2f823ff6fcaa7f3f0f9b990dc90512d8901e5d64/specification/security/query_user/SecurityQueryUserRequest.ts#L25-L75

func NewRequest

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON

func (r *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

func (*Request) UnmarshalJSON

func (s *Request) UnmarshalJSON(data []byte) error

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

https://github.com/elastic/elasticsearch-specification/blob/2f823ff6fcaa7f3f0f9b990dc90512d8901e5d64/specification/security/query_user/SecurityQueryUserResponse.ts#L23-L38

func NewResponse

func NewResponse() *Response

NewResponse returns a Response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL