artifacts

package module
v1.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveArtifact

func SaveArtifact(ctx context.Context, fs FilesystemRW, artifact *models.Artifact, data Artifact) error

Types

type Artifact

type Artifact struct {
	ContentType string
	Path        string
	Content     io.ReadCloser
}

type Filesystem

type Filesystem interface {
	Close() error
	ReadDir(name string) ([]os.FileInfo, error)
	Stat(name string) (os.FileInfo, error)
}

type FilesystemRW

type FilesystemRW interface {
	Filesystem
	Read(ctx gocontext.Context, path string) (io.ReadCloser, error)
	Write(ctx gocontext.Context, path string, data io.Reader) (os.FileInfo, error)
}

func GetFSForConnection

func GetFSForConnection(ctx context.Context, c models.Connection) (FilesystemRW, error)

type MIMEWriter

type MIMEWriter struct {
	Max int // max number of bytes to use from the source
	// contains filtered or unexported fields
}

MIMEWriter implements io.Writer with a limit on the number of bytes used for detection.

func (*MIMEWriter) Detect

func (t *MIMEWriter) Detect() *mimetype.MIME

func (*MIMEWriter) Write

func (t *MIMEWriter) Write(bb []byte) (n int, err error)

Directories

Path Synopsis
clients
aws
gcp
smb
internal
fs

Jump to

Keyboard shortcuts

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