gelv

package module
v0.0.0-...-48f0a7f Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 5 Imported by: 1

README

Gelv

Gelv is a simple package for getting elevated privileges in golang

Install with

$ go get github.com/jacobtread/gelv

Example Usage

func main() {
    if !gelv.IsElevated() { // Check the app isn't already elevated
        gelv.Elevate() // Elevate the app
        return // Stop execution
    }
    // TODO: Your normal application code
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Elevate

func Elevate()

Elevate tells windows to elevate the current application. Will relaunch this app with the required perms make sure to check IsAdmin before running any app logic to be sure you don't continue executing

func IsElevated

func IsElevated() bool

IsElevated checks whether the application has elevated permissions or not. The user shouldn't be able to access the path if they are not elevated

Types

This section is empty.

Jump to

Keyboard shortcuts

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