database

package
v0.0.0-...-dbec4ac Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DriverName = "sqlite3"
	DbName     = "/home/ubuntu/ECE_422_Project_1/db/sfs.db"
)
View Source
const AddCheckSum = `
	INSERT INTO check_sums (file_path, check_sum) VALUES (?, ?)
`
View Source
const AddGroupPermissionsQuery = `` /* 147-byte string literal not displayed */
View Source
const AddGroupQuery = `INSERT INTO groups (group_name) values ($1)`
View Source
const AddPermissionForAllUsersGroups = `` /* 249-byte string literal not displayed */
View Source
const AddUserPermissionsQuery = `
INSERT
INTO file_permissions
select ?, id, null, TRUE, TRUE
from users
where username = ?;
`
View Source
const AddUserQuery = `INSERT INTO users (username, password) values ($1, $2)`
View Source
const AddUserToGroupQuery = `` /* 155-byte string literal not displayed */
View Source
const AuthenticateUserQuery = `` /* 265-byte string literal not displayed */
View Source
const ChangeFilePathCheckSums = `
UPDATE check_sums
SET file_path = ?
WHERE file_path = ?;
`
View Source
const ChangeFilePathPermission = `
UPDATE file_permissions
SET file_path = ?
WHERE file_path = ?;
`
View Source
const CheckUserExistsQuery = `` /* 263-byte string literal not displayed */
View Source
const CheckUserGroupsPermissionQuery = `` /* 551-byte string literal not displayed */
View Source
const CheckUserHasPermissionQuery = `` /* 407-byte string literal not displayed */
View Source
const GetCheckSum = `
	select check_sum
	from check_sums
	where file_path = ?
`
View Source
const Schema = `` /* 1023-byte string literal not displayed */
View Source
const UpdateCheckSum = `
	UPDATE check_sums
	SET check_sum = ?
	WHERE file_path = ?
`
View Source
const UpdateGroupPermissions = `` /* 277-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type PermissionDao

type PermissionDao struct {
	// contains filtered or unexported fields
}
var Dao *PermissionDao

func NewPermissionDao

func NewPermissionDao() (*PermissionDao, error)

func (*PermissionDao) AddCheckSum

func (dao *PermissionDao) AddCheckSum(path string, checkSum string) error

func (*PermissionDao) AddGroup

func (dao *PermissionDao) AddGroup(groupName string) error

func (*PermissionDao) AddGroupPermission

func (dao *PermissionDao) AddGroupPermission(groupName string, path string) error

func (*PermissionDao) AddUser

func (dao *PermissionDao) AddUser(username string, password string) error

func (*PermissionDao) AddUserPermission

func (dao *PermissionDao) AddUserPermission(username string, path string) error

func (*PermissionDao) AddUserToGroup

func (dao *PermissionDao) AddUserToGroup(username string, groupName string) error

func (*PermissionDao) Authenticate

func (dao *PermissionDao) Authenticate(username string, password string) (bool, error)

func (*PermissionDao) ChangeFilePath

func (dao *PermissionDao) ChangeFilePath(oldPath string, newPath string) error

func (*PermissionDao) CheckUserExists

func (dao *PermissionDao) CheckUserExists(username string) (bool, error)

func (*PermissionDao) CheckUserPermission

func (dao *PermissionDao) CheckUserPermission(username string, path string) (bool, error)

func (*PermissionDao) CheckUsersGroupPermission

func (dao *PermissionDao) CheckUsersGroupPermission(username string, path string) (bool, error)

func (*PermissionDao) GetCheckSum

func (dao *PermissionDao) GetCheckSum(path string) (string, error)

func (*PermissionDao) UpdateCheckSum

func (dao *PermissionDao) UpdateCheckSum(path string, checkSum string) error

func (*PermissionDao) UpdatePermissionForAllUsersGroups

func (dao *PermissionDao) UpdatePermissionForAllUsersGroups(username string, path string) error

Jump to

Keyboard shortcuts

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