Saturday, March 25, 2023
HomeGolangObtain some worths just with piece variables - Obtaining Assistance

Obtain some worths just with piece variables – Obtaining Assistance


hi i’m brand-new customer of go.
I have actually succeded to utilize this collection: GitHub – Nerzal/gocloak: golang keycloak customer
to link to keycloak, i require to note usernames just
in the meantime, i can just have all qualities …

There is a param struct;

 kind GetUsersParams struct {
BriefRepresentation * bool 'json:" briefRepresentation, string, omitempty"'.
Email * string 'json:" e-mail, omitempty"'.
EmailVerified * bool 'json:" emailVerified, string, omitempty"'.
Allowed * bool 'json:" made it possible for, string, omitempty"'.
Specific * bool 'json:" precise, string, omitempty"'.
First * int 'json:" initially, string, omitempty"'.
FirstName * string 'json:" firstName, omitempty"'.
IDPAlias * string 'json:" idpAlias, omitempty"'.
IDPUserID * string 'json:" idpUserId, omitempty"'.
LastName * string 'json:" lastName, omitempty"'.
Max * int 'json:" max, string, omitempty"'.
Q * string 'json:" q, omitempty"'.
Browse * string 'json:" search, omitempty"'.
Username * string 'json:" username, omitempty"'.
}

there is this feature:

 func (customer * gocloak) GetUsers( ctx context.Context, token, world string, params GetUsersParams) ([] * Individual, mistake) {
const errMessage="might not obtain customers".

var outcome [] * Individual.
queryParams, err:= GetQueryParams( params).
if err!= nil {
return nil, errors.Wrap( err, errMessage).
}

resp, err:= client.getRequestWithBearerAuth( ctx, token).
SetResult(&& outcome).
SetQueryParams( queryParams).
Obtain( client.getAdminRealmURL( world, "customers")).

if err:= checkForError( resp, err, errMessage); err!= nil {
return nil, err.
}

return outcome, nil.
}

When calling this feature similar to this, it functions
userlist, err:= client.GetUsers( ctx, token.AccessToken, "testrealm", gocloak.GetUsersParams {} )
i would certainly such as just obtain the Username by passing worth in GetUsersParams, i attempted yet i can not discover, can somebody aid me?

RELATED ARTICLES

Most Popular

Recent Comments