mongodb

package
v0.1.1-0...-a907221 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUserPassword

func CheckUserPassword(database string, username string, password string) string

func NewClient

func NewClient(connectionString string) (interface{}, error)

Creates connection

func Provider

func Provider() terraform.ResourceProvider

func RedactMongoUri

func RedactMongoUri(uri string) string

RedactMongoUri removes login and password from mongoUri.

func ResourceMongoDBRoleCreate

func ResourceMongoDBRoleCreate(d *schema.ResourceData, m interface{}) error

func ResourceMongoDBRoleDelete

func ResourceMongoDBRoleDelete(d *schema.ResourceData, m interface{}) error

func ResourceMongoDBRoleExists

func ResourceMongoDBRoleExists(d *schema.ResourceData, m interface{}) (bool, error)

func ResourceMongoDBRoleImport

func ResourceMongoDBRoleImport(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error)

func ResourceMongoDBRoleRead

func ResourceMongoDBRoleRead(d *schema.ResourceData, m interface{}) error

func ResourceMongoDBRoleUpdate

func ResourceMongoDBRoleUpdate(d *schema.ResourceData, m interface{}) error

func ResourceMongoDBUserCreate

func ResourceMongoDBUserCreate(d *schema.ResourceData, m interface{}) error

func ResourceMongoDBUserDelete

func ResourceMongoDBUserDelete(d *schema.ResourceData, m interface{}) error

func ResourceMongoDBUserExists

func ResourceMongoDBUserExists(d *schema.ResourceData, m interface{}) (bool, error)

func ResourceMongoDBUserImport

func ResourceMongoDBUserImport(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error)

func ResourceMongoDBUserRead

func ResourceMongoDBUserRead(d *schema.ResourceData, m interface{}) error

func ResourceMongoDBUserUpdate

func ResourceMongoDBUserUpdate(d *schema.ResourceData, m interface{}) error

Types

type CheckRole

type CheckRole struct {
	Role string `bson:"role"`
	Db   string `bson:"db"`
}

type CheckUser

type CheckUser struct {
	Username string `bson:"user"`
	Db       string `bson:"db"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (*Client) CheckRole

func (client *Client) CheckRole(name string) (string, error)

func (*Client) CheckUser

func (client *Client) CheckUser(name string) (string, error)

func (*Client) CreateRole

func (client *Client) CreateRole(role Role) error

func (*Client) CreateUser

func (client *Client) CreateUser(user User) error

func (*Client) DeleteRole

func (client *Client) DeleteRole(role Role) error

func (*Client) DeleteUser

func (client *Client) DeleteUser(user User) error

func (*Client) GetRole

func (client *Client) GetRole(dbName string, role string) (*Role, error)

func (*Client) GetUser

func (client *Client) GetUser(databaseName string, name string) (*User, error)

func (*Client) UpdateRole

func (client *Client) UpdateRole(role Role) error

func (*Client) UpdateUser

func (client *Client) UpdateUser(user User) error

type CreateResult

type CreateResult struct {
	Ok int `bson:"ok"`
}

func (*CreateResult) IsOk

func (c *CreateResult) IsOk() bool

type Privilege

type Privilege struct {
	Resource Resource `bson:"resource"`
	Actions  []string `bson:"actions"`
}

type Resource

type Resource struct {
	Cluster    bool    `bson:"cluster"`
	Db         *string `bson:"db,omitempty"`
	Collection *string `bson:"collection,omitempty"`
}

type Role

type Role struct {
	Role       string      `bson:"role"`
	Db         string      `bson:"db"`
	Roles      []RoleRef   `bson:"roles"`
	Privileges []Privilege `bson:"privileges"`
}

type RoleInfoResult

type RoleInfoResult struct {
	Ok    int    `bson:"ok"`
	Roles []Role `bson:"roles"`
}

type RoleRef

type RoleRef struct {
	Role string `bson:"role"`
	Db   string `bson:"db"`
}

type User

type User struct {
	Username    string    `bson:"user"`
	Password    string    `bson:"-"`
	Description string    `bson:"customData.description"`
	Db          string    `bson:"db"`
	Roles       []RoleRef `bson:"roles"`
}

type UsersInfoResult

type UsersInfoResult struct {
	Ok    int    `bson:"ok"`
	Users []User `bson:"users"`
}

Jump to

Keyboard shortcuts

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