mongodb

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MongoClientInit

func MongoClientInit(conf *MongoDatabaseConfiguration) (*mongo.Client, error)

func Provider

func Provider() *schema.Provider

Types

type ClientConfig

type ClientConfig struct {
	Host               string
	Port               string
	Username           string
	Password           string
	DB                 string
	Ssl                bool
	InsecureSkipVerify bool
	ReplicaSet         string
	RetryWrites        bool
	Certificate        string
	Direct             bool
}

func (*ClientConfig) MongoClient

func (c *ClientConfig) MongoClient() (*mongo.Client, error)

type DbUser

type DbUser struct {
	Name     string `json:"name"`
	Password string `json:"password"`
}

type MongoDatabaseConfiguration

type MongoDatabaseConfiguration struct {
	Config          *ClientConfig
	MaxConnLifetime time.Duration
}

type Privilege

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

func (Privilege) String

func (privilege Privilege) String() string

type PrivilegeDto

type PrivilegeDto struct {
	Db         string   `json:"db"`
	Collection string   `json:"collection"`
	Actions    []string `json:"actions"`
}

type Resource

type Resource struct {
	Db         string `json:"db"`
	Collection string `json:"collection"`
}

func (Resource) String

func (resource Resource) String() string

type Role

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

func (Role) String

func (role Role) String() string

type SingleResultGetRole

type SingleResultGetRole struct {
	Roles []struct {
		Role           string `json:"role"`
		Db             string `json:"db"`
		InheritedRoles []struct {
			Role string `json:"role"`
			Db   string `json:"db"`
		} `json:"inheritedRoles"`
		Privileges []struct {
			Resource struct {
				Db         string `json:"db"`
				Collection string `json:"collection"`
			} `json:"resource"`
			Actions []string `json:"actions"`
		} `json:"privileges"`
	} `json:"roles"`
}

type SingleResultGetUser

type SingleResultGetUser struct {
	Users []struct {
		Id    string `json:"_id"`
		User  string `json:"user"`
		Db    string `json:"db"`
		Roles []struct {
			Role string `json:"role"`
			Db   string `json:"db"`
		} `json:"roles"`
	} `json:"users"`
}

Jump to

Keyboard shortcuts

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