filehitch

package
v0.0.0-...-dde1a55 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTempFile

func CreateTempFile() (file *os.File, err error)

func DecryptWriteToFileAndChecksum

func DecryptWriteToFileAndChecksum(file *os.File, src io.Reader, password []byte) (sum []byte, err error)

func ScheduleJobs

func ScheduleJobs(jobs []Job)

func WriteToFileAndChecksum

func WriteToFileAndChecksum(file *os.File, src io.Reader) (sum []byte, err error)

Types

type Decryption

type Decryption struct {
	Password []byte
}

type Expect

type Expect struct {
	Code int
}

type File

type File struct {
	Path        string
	Permissions Permissions
}

type HTTPResource

type HTTPResource struct {
	URL         string
	Method      string
	Headers     map[string][]string
	Expect      Expect
	Timeout     time.Duration
	Body        []byte
	MaxAttempts int
	// contains filtered or unexported fields
}

func (*HTTPResource) AddHeaders

func (resource *HTTPResource) AddHeaders(req *http.Request)

type Job

type Job struct {
	Name     string
	Schedule Schedule
	Resource Resource
	File     File
	Trigger  Trigger
}

func (*Job) CalculateFileChecksum

func (job *Job) CalculateFileChecksum() (sum []byte, err error)

func (*Job) ExecuteTrigger

func (job *Job) ExecuteTrigger() (err error)

func (*Job) FinalizePlacement

func (job *Job) FinalizePlacement(tempFile *os.File) (err error)

func (*Job) HandleHTTPResource

func (job *Job) HandleHTTPResource() (changed bool, err error)

func (*Job) HandleS3Resource

func (job *Job) HandleS3Resource() (changed bool, err error)

func (*Job) Run

func (job *Job) Run()

func (*Job) UpdateFile

func (job *Job) UpdateFile(src io.ReadCloser) (changed bool, err error)

type Permissions

type Permissions struct {
	Mode  fs.FileMode
	Owner string
	Group string
}

type Resource

type Resource struct {
	Type       string
	Decryption Decryption
	HTTP       *HTTPResource
	S3         *S3Resource
}

type S3Resource

type S3Resource struct {
	Endpoint        string
	AccessKeyID     string
	SecretAccessKey string
	Bucket          string
	Region          string
	SSL             bool
	Object          string
	// contains filtered or unexported fields
}

type Schedule

type Schedule struct {
	Expression string
	Timezone   *time.Location
	Jitter     int
}

type Trigger

type Trigger struct {
	Command []string
	User    string
	Group   string
	CWD     string
}

Jump to

Keyboard shortcuts

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