Documentation ¶
Index ¶
- type CreateRequest
- type CreateResponse
- type GetResponse
- type ListResponse
- type MongoDBUsersService
- func (svc *MongoDBUsersService) Create(ctx context.Context, projectID, instanceID, userID, username, database string, ...) (res CreateResponse, err error)
- func (svc *MongoDBUsersService) Get(ctx context.Context, projectID, instanceID, userID string) (res GetResponse, err error)
- func (svc *MongoDBUsersService) List(ctx context.Context, projectID, instanceID string) (res ListResponse, err error)
- type User
- type UserGetItem
- type UserListItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateRequest ¶
type CreateRequest struct { Database string `json:"database,omitempty"` Roles []string `json:"roles,omitempty"` Username string `json:"username,omitempty"` }
CreateRequest holds data for requesting new user
type CreateResponse ¶
type CreateResponse struct {
Item User `json:"item,omitempty"`
}
CreateResponse is the server response when creating a new user
type GetResponse ¶
type GetResponse struct {
Item UserGetItem `json:"item,omitempty"`
}
GetResponse is a struct representing the server's get response
type ListResponse ¶
type ListResponse struct { Count int `json:"count,omitempty"` Items []UserListItem `json:"items,omitempty"` }
ListResponse represents a list of users returned from the server
type MongoDBUsersService ¶
MongoDBUsersService is the service that manages MongoDB Flex instances
func (*MongoDBUsersService) Create ¶
func (svc *MongoDBUsersService) Create(ctx context.Context, projectID, instanceID, userID, username, database string, roles []string) (res CreateResponse, err error)
Create adds a new MongoDB user and returns the server response (CreateResponse) and error if occurred See also https://api.stackit.schwarz/mongo-flex-service/openapi.html#tag/user/paths/~1projects~1{projectId}~1instances~1{instanceId}~1users~1{userId}/post
func (*MongoDBUsersService) Get ¶
func (svc *MongoDBUsersService) Get(ctx context.Context, projectID, instanceID, userID string) (res GetResponse, err error)
Get returns the user information by project, instance ID and user ID See also https://api.stackit.schwarz/mongo-flex-service/openapi.html#tag/user/paths/~1projects~1{projectId}~1instances~1{instanceId}~1users~1{userId}/get
func (*MongoDBUsersService) List ¶
func (svc *MongoDBUsersService) List(ctx context.Context, projectID, instanceID string) (res ListResponse, err error)
List returns a list of MongoDB Flex users See also https://api.stackit.schwarz/mongo-flex-service/openapi.html#tag/user/paths/~1projects~1{projectId}~1instances~1{instanceId}~1users/get
type User ¶
type User struct { Database string `json:"database,omitempty"` Hostname string `json:"hostname,omitempty"` ID string `json:"id,omitempty"` Password string `json:"password,omitempty"` Port int `json:"port,omitempty"` Roles []string `json:"roles,omitempty"` URI string `json:"uri,omitempty"` Username string `json:"username,omitempty"` }
User represents a user with access to the database
type UserGetItem ¶
type UserGetItem struct { Database string `json:"database,omitempty"` Hostname string `json:"hostname,omitempty"` ID string `json:"id,omitempty"` Port int `json:"port,omitempty"` Roles []string `json:"roles,omitempty"` Username string `json:"username,omitempty"` }
UserGetItem is an item in GetResponse
type UserListItem ¶
type UserListItem struct { ID string `json:"id,omitempty"` Username string `json:"username,omitempty"` }
UserListItem is an item in the Items list of ListResponse