users

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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

type MongoDBUsersService common.Service

MongoDBUsersService is the service that manages MongoDB Flex instances

func New

New returns a new handler for the service

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

Jump to

Keyboard shortcuts

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