Documentation ¶
Index ¶
- Constants
- type AtlasOptions
- type AtlasRepository
- type Grant
- type MongoDBOptions
- type MongoDBRepository
- type MongoDBRole
- type MongoDBRoles
- type MongoDBUser
- type MongoDBUsers
- type PostgreSQLOptions
- type PostgreSQLRepository
- func (s *PostgreSQLRepository) Close(ctx context.Context) error
- func (s *PostgreSQLRepository) CreateDatabaseIfNotExists(ctx context.Context, database string) error
- func (s *PostgreSQLRepository) CreateSchema(ctx context.Context, db, name string) error
- func (s *PostgreSQLRepository) DropUser(ctx context.Context, user PostgresqlUser) error
- func (s *PostgreSQLRepository) EnableExtension(ctx context.Context, db, name string) error
- func (s *PostgreSQLRepository) RevokeAllPrivileges(ctx context.Context, user PostgresqlUser) error
- func (s *PostgreSQLRepository) SetupUser(ctx context.Context, user PostgresqlUser) error
- type PostgresqlUser
- type Privilege
Constants ¶
View Source
const ( DefaultPostgreSQLReadRole = "read" DefaultPostgreSQLReadWriteRole = "readWrite" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtlasOptions ¶
type AtlasRepository ¶
type AtlasRepository struct {
// contains filtered or unexported fields
}
func NewAtlasRepository ¶
func NewAtlasRepository(ctx context.Context, opts AtlasOptions) (*AtlasRepository, error)
func (*AtlasRepository) SetupUser ¶
func (m *AtlasRepository) SetupUser(ctx context.Context, database string, username string, password string, roles MongoDBRoles) error
type MongoDBOptions ¶
type MongoDBRepository ¶
type MongoDBRepository struct {
// contains filtered or unexported fields
}
func NewMongoDBRepository ¶
func NewMongoDBRepository(ctx context.Context, opts MongoDBOptions) (*MongoDBRepository, error)
func (*MongoDBRepository) SetupUser ¶
func (m *MongoDBRepository) SetupUser(ctx context.Context, database string, username string, password string, roles MongoDBRoles) error
type MongoDBRole ¶
type MongoDBRoles ¶
type MongoDBRoles []MongoDBRole
type MongoDBUser ¶
type MongoDBUser struct { User string `json:"user" bson:"user"` DB string `json:"db" bson:"db"` Roles MongoDBRoles `json:"roles" bson:"roles"` }
type MongoDBUsers ¶
type MongoDBUsers []MongoDBUser
type PostgreSQLOptions ¶
type PostgreSQLRepository ¶
type PostgreSQLRepository struct {
// contains filtered or unexported fields
}
func NewPostgreSQLRepository ¶
func NewPostgreSQLRepository(ctx context.Context, opts PostgreSQLOptions) (*PostgreSQLRepository, error)
func (*PostgreSQLRepository) Close ¶
func (s *PostgreSQLRepository) Close(ctx context.Context) error
func (*PostgreSQLRepository) CreateDatabaseIfNotExists ¶
func (s *PostgreSQLRepository) CreateDatabaseIfNotExists(ctx context.Context, database string) error
TODO Prepared Statements
func (*PostgreSQLRepository) CreateSchema ¶
func (s *PostgreSQLRepository) CreateSchema(ctx context.Context, db, name string) error
func (*PostgreSQLRepository) DropUser ¶
func (s *PostgreSQLRepository) DropUser(ctx context.Context, user PostgresqlUser) error
func (*PostgreSQLRepository) EnableExtension ¶
func (s *PostgreSQLRepository) EnableExtension(ctx context.Context, db, name string) error
func (*PostgreSQLRepository) RevokeAllPrivileges ¶
func (s *PostgreSQLRepository) RevokeAllPrivileges(ctx context.Context, user PostgresqlUser) error
func (*PostgreSQLRepository) SetupUser ¶
func (s *PostgreSQLRepository) SetupUser(ctx context.Context, user PostgresqlUser) error
type PostgresqlUser ¶
Click to show internal directories.
Click to hide internal directories.