util

package
v0.0.0-...-4ba091f Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2016 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bash

func Bash(command string) string

func ChkPaternity

func ChkPaternity(owner string, child string) bool

func ChkPerms

func ChkPerms(selected_object string, uid int, gid int) bool

true means the user has access to the file/dir

func Cmd

func Cmd(cmd string, args []string) (string, error)

func FileLockCheck

func FileLockCheck(str string, list []string) bool

func GetCLI

func GetCLI(key string) map[string]string

func Getusers

func Getusers(username string, data map[string]map[string]string, db *sql.DB) map[string]map[string]string

func IndexOfString

func IndexOfString(str string, list []string) int

func IsInterface

func IsInterface(ip_addr string) bool

func LastResortSanitize

func LastResortSanitize(str string) string

func MD5SUM

func MD5SUM(path string) string

func MkToken

func MkToken() string

func Query

func Query(ctx *macaron.Context, name string) string

func RemoveInArray

func RemoveInArray(str string, list []string) []string

func SHSanitize

func SHSanitize(str string) string

func Sudo

func Sudo(username string, ctx *macaron.Context)

func SurfGet

func SurfGet(siteurl string) string

func SurfPost

func SurfPost(siteurl string, postdata string) string

Types

type API_function

type API_function func(ctx *macaron.Context) string

type Config

type Config struct {
	Hostcontrol struct {
		License string
	}
	Webserver struct {
		Bind string
		Port string
	}
	MySQL struct {
		Dbname string
		Host   string
		User   string
		Pass   string
		Port   string
		Socket string
	}
}

func ReadConfig

func ReadConfig(config_file string) (Config, error)

type User

type User struct {
	Hostcontrol_id  int
	System_username string
	Privileges      string
	Owned_by        string
	Login_token     string
	Email_address   string
	HomeDir         string
	Sudo            bool
}

func Auth

func Auth(ctx *macaron.Context, permission string) (User, bool)

Jump to

Keyboard shortcuts

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