filevalidator

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileValidator

type FileValidator interface {
	Validate(string, []byte) error
}

FileValidator can take a file name and a slice of bytes and validate that the target file for a name contains the same bytes. It's only used for tests.

type Local

type Local struct {
	Path string
}

Local validates files against local filesystem

func (*Local) Validate

func (lfv *Local) Validate(name string, reference []byte) error

Validate takes a name of a local file and compares the contents of a local file with this name to a byte-slice returning an error if they don't match.

type S3

type S3 struct {
	AccessKeyID     string
	SecretAccessKey string
	Region          string
	Bucket          string
}

S3 validates S3 files

func (*S3) Validate

func (v *S3) Validate(name string, reference []byte) error

Validate takes a name of an S3 file and compares the contents of a file with this name to a byte-slice returning an error if they don't match.

Jump to

Keyboard shortcuts

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