DescribeUser()
This method returns the detailed information about the specified user.
func (c *Client) DescribeUser(ctx context.Context, opt DescribeUserOption, callOpts ...grpc.CallOption) (*entity.User, error)
Request Parameters
| Parameter | Description | Type | 
|---|---|---|
| 
 | Context for the current call to work. | 
 | 
| 
 | Optional parameters of the methods. | |
| 
 | Optional parameters for calling the methods. | 
 | 
DescribeUserOption
This is an interface type. The describeUserOption struct type implements this interface type.
You can use the NewDescribeUserOption() function to get the concrete implementation.
NewDescribeUserOption
The signature of NewDescribeUserOption() is as follows:
func NewDescribeUserOption(userName string) *describeUserOption
| Parameter | Description | Type | 
|---|---|---|
| 
 | Name of the user to describe. | 
 | 
grpc.CallOption
This interface provided by the gRPC Go library allows you to specify additional options or configurations when making requests. For possible implementations of this interface, refer to this file.
entity.User
The entity.User struct type is as follows:
type User struct {
    UserName   string
    Roles      []string
}
Return
*[entity.User](./v2-Authentication-DescribeUser#entityuser)
Example
import (
   "context"
   "google.golang.org/grpc"
   "github.com/milvus-io/milvus/client/v2/milvusclient"
)
userName := "my_user"
opts := client.NewDescribeUserOption(userName)
onFinish := func(ctx context.Context, err error) {
    if err != nil {
        fmt.Printf("gRPC call finished with error: %v\n", err)
    } else {
        fmt.Printf("gRPC call finished successfully")
    }
}
callOption := grpc.OnFinish(onFinish)
err := mclient.DescribeUser(context.Background(), opts, callOption)