archive

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StreamTypeStdout = "stdout"
	StreamTypeStderr = "stderr"
	StreamTypeError  = "error"
)

Variables

This section is empty.

Functions

func EnsureWithinStackPath

func EnsureWithinStackPath(path, stackPath string) error

func ValidateCreateOptions

func ValidateCreateOptions(options []string) error

func ValidateExtractOptions

func ValidateExtractOptions(options []string) error

func ValidateExtractPath

func ValidateExtractPath(destPath, fileName string) (string, error)

Types

type ArchiveHandler

type ArchiveHandler interface {
	Create(ctx context.Context, basePath string, opts CreateOptions, writer ProgressWriter) error
	Extract(ctx context.Context, opts ExtractOptions, writer ProgressWriter) error
}

type CreateOptions

type CreateOptions struct {
	Format          string
	OutputPath      string
	IncludePaths    []string
	ExcludePatterns []string
	Compression     string
}

type ExtractOptions

type ExtractOptions struct {
	ArchivePath     string
	DestinationPath string
	Overwrite       bool
	CreateDirs      bool
}

type OperationsProgressWriter

type OperationsProgressWriter struct {
	// contains filtered or unexported fields
}

func NewOperationsProgressWriter

func NewOperationsProgressWriter(writer io.Writer) *OperationsProgressWriter

func (*OperationsProgressWriter) WriteError

func (w *OperationsProgressWriter) WriteError(data string)

func (*OperationsProgressWriter) WriteMessage

func (w *OperationsProgressWriter) WriteMessage(msgType string, data string)

func (*OperationsProgressWriter) WriteStdout

func (w *OperationsProgressWriter) WriteStdout(data string)

type ProgressWriter

type ProgressWriter interface {
	WriteMessage(msgType string, data string)
	WriteError(data string)
	WriteStdout(data string)
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService() *Service

func (*Service) CreateArchive

func (s *Service) CreateArchive(ctx context.Context, basePath string, opts CreateOptions, writer ProgressWriter) error

func (*Service) ExtractArchive

func (s *Service) ExtractArchive(ctx context.Context, basePath string, opts ExtractOptions, writer ProgressWriter) error

type StreamMessage

type StreamMessage struct {
	Type      string    `json:"type"`
	Data      string    `json:"data"`
	Timestamp time.Time `json:"timestamp"`
}

type TarHandler

type TarHandler struct{}

func NewTarHandler

func NewTarHandler() *TarHandler

func (*TarHandler) Create

func (h *TarHandler) Create(ctx context.Context, basePath string, opts CreateOptions, writer ProgressWriter) error

func (*TarHandler) Extract

func (h *TarHandler) Extract(ctx context.Context, opts ExtractOptions, writer ProgressWriter) error

type ZipHandler

type ZipHandler struct{}

func NewZipHandler

func NewZipHandler() *ZipHandler

func (*ZipHandler) Create

func (h *ZipHandler) Create(ctx context.Context, basePath string, opts CreateOptions, writer ProgressWriter) error

func (*ZipHandler) Extract

func (h *ZipHandler) Extract(ctx context.Context, opts ExtractOptions, writer ProgressWriter) error

Jump to

Keyboard shortcuts

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