Documentation ¶
Overview ¶
Package view provides a simple way of checking access to a table
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessInfo ¶ added in v1.1.8
type AccessInfo struct {
// contains filtered or unexported fields
}
AccessInfo holds a database and table name and information on whether the table is reachable
func NewAccessInfo ¶ added in v1.1.8
func NewAccessInfo(database, table string) AccessInfo
NewAccessInfo returns a new AccessInfo type
func (*AccessInfo) CheckSelectError ¶ added in v1.1.8
func (ta *AccessInfo) CheckSelectError(db *sql.DB) error
CheckSelectError returns whether SELECT works on the table
func (AccessInfo) Database ¶ added in v1.1.8
func (ta AccessInfo) Database() string
Database returns the database name
func (AccessInfo) Name ¶ added in v1.1.8
func (ta AccessInfo) Name() string
Name returns the fully qualified table name
func (AccessInfo) SelectError ¶ added in v1.1.8
func (ta AccessInfo) SelectError() error
SelectError returns the result of ta.selectError
func (AccessInfo) Table ¶ added in v1.1.8
func (ta AccessInfo) Table() string
Table returns the table name
type Code ¶ added in v0.6.0
type Code int
Code represents the type of information to view (as an int)
const ( ViewNone Code = iota // view nothing (should never be set) ViewLatency // view the table latency information ViewOps // view the table information by number of operations ViewIO // view the file I/O information ViewLocks // view lock information ViewUsers // view user information ViewMutex // view mutex information ViewStages // view SQL stages information ViewMemory // view memory usage (5.7+) )
View* constants represent different views we can see
type View ¶
type View struct {
// contains filtered or unexported fields
}
View holds the integer type of view (maybe need to fix this setup)
func SetupAndValidate ¶ added in v1.0.15
SetupAndValidate setups the view configuration and validates if accesss to the p_s tables is permitted.
func (*View) SetByName ¶
SetByName sets the view name to use based on its name. - If we provide an empty name then use the default. - If we don't provide a valid name then give an error