file

package
v0.0.0-...-1239505 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: GPL-2.0-only

Index

Constants

View Source
const (
	StatusDisable = 0
	StatusEnable  = 1
)
View Source
const (
	FlagAny    = 0
	FlagNew    = 1
	FlagUpdate = 2
)
View Source
const (
	StatusPolicyNormal       = 0
	StatusPolicyUnknown      = 1
	StatusPolicyConflict     = 2
	StatusPolicyFileNotExist = 3
)
View Source
const (
	StatusEventUnread = 0
	StatusEventRead   = 1
)

Variables

View Source
var (
	ErrorEnable      = errors.New("file protection enable failed")
	ErrorDisable     = errors.New("file protection disable failed")
	ErrorClearPolicy = errors.New("clear file policy failed")
)

Functions

func ClearPolicy

func ClearPolicy() bool

func Disable

func Disable() bool

func Enable

func Enable() bool

func SetPolicy

func SetPolicy(path string, perm, flag int) (fsid, ino int64, status int, err error)

Types

type Event

type Event struct {
	ID        int64  `json:"id"`
	Path      string `json:"path"`
	Fsid      int64  `json:"fsid"`
	Ino       int64  `json:"ino"`
	Perm      int    `json:"perm"`
	Timestamp int64  `json:"timestamp"`
	Policy    int64  `json:"policy"`
	Status    int    `json:"status"`
}

type Policy

type Policy struct {
	ID        int64  `json:"id"`
	Path      string `json:"path"`
	Fsid      int64  `json:"fsid"`
	Ino       int64  `json:"ino"`
	Perm      int    `json:"perm"`
	Timestamp int64  `json:"timestamp"`
	Status    int    `json:"status"`
}

Jump to

Keyboard shortcuts

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