Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACL ¶
type ACL struct { Privileges Privileges GrantOptions Privileges Role string GrantedBy string }
ACL represents a single PostgreSQL `aclitem` entry.
func (ACL) GetGrantOption ¶
func (a ACL) GetGrantOption(priv Privileges) bool
GetGrantOption returns true if the acl has the grant option set for the specified priviledge.
func (ACL) GetPrivilege ¶
func (a ACL) GetPrivilege(priv Privileges) bool
GetPriviledge returns true if the acl has the specified priviledge set.
type Database ¶
type Database struct {
ACL
}
Database models the privileges of a database aclitem
func NewDatabase ¶
NewDatabase parses an ACL object and returns a Database object.
type ForeignDataWrapper ¶
type ForeignDataWrapper struct {
ACL
}
ForeignDataWrapper models the privileges of a domain aclitem
func NewForeignDataWrapper ¶
func NewForeignDataWrapper(acl ACL) (ForeignDataWrapper, error)
NewForeignDataWrapper parses an ACL object and returns a ForeignDataWrapper object.
type ForeignServer ¶
type ForeignServer struct {
ACL
}
ForeignServer models the privileges of a foreign server aclitem
func NewForeignServer ¶
func NewForeignServer(acl ACL) (ForeignServer, error)
NewForeignServer parses an ACL object and returns a ForeignServer object.
type Function ¶
type Function struct {
ACL
}
Function models the privileges of a function aclitem
func NewFunction ¶
NewFunction parses an ACL object and returns a Function object.
type Language ¶
type Language struct {
ACL
}
Language models the privileges of a language aclitem
func NewLanguage ¶
NewLanguage parses an ACL object and returns a Language object.
type LargeObject ¶
type LargeObject struct {
ACL
}
LargeObject models the privileges of a large object aclitem
func NewLargeObject ¶
func NewLargeObject(acl ACL) (LargeObject, error)
NewLargeObject parses an ACL object and returns a LargeObject object.
type Privileges ¶
type Privileges uint16
Privileges represents a PostgreSQL ACL bitmask
const ( NoPrivs Privileges = 0 // Ordering taken from postgresql/src/include/nodes/parsenodes.h Insert Privileges = 1 << iota Select Update Delete Truncate References Trigger Execute Usage Create Temporary Connect )
See postgresql/src/include/utils/acl.h for inspiration. Like PostgreSQL, "rights" refer to the combined grant option and privilege bits fields.
type Schema ¶
type Schema struct {
ACL
}
Schema models the privileges of a schema aclitem
func (Schema) Grants ¶
Grants returns a list of SQL queries that constitute the privileges specified in the receiver for the target schema.
type Sequence ¶
type Sequence struct {
ACL
}
Sequence models the privileges of a sequence aclitem
func NewSequence ¶
NewSequence parses a PostgreSQL ACL string for a sequence and returns a Sequence object
type Tablespace ¶
type Tablespace struct {
ACL
}
Tablespace models the privileges of a tablespace aclitem
func NewTablespace ¶
func NewTablespace(acl ACL) (Tablespace, error)
NewTablespace parses an ACL object and returns a Tablespace object.