app

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package app provides the main application logic for GitLab backup.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoStorageDefined is returned when no storage configuration is provided.
	ErrNoStorageDefined = errors.New("no storage defined")
	// ErrBackupErrors is returned when errors occur during backup process.
	ErrBackupErrors = errors.New("errors occurred during backup")
	// ErrNotDirectory is returned when a path is not a directory.
	ErrNotDirectory = errors.New("path is not a directory")
)

Functions

This section is empty.

Types

type App

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

App represents the main application structure.

func NewApp

func NewApp(cfg *config.Config) (*App, error)

NewApp returns a new App struct.

func (*App) ExportGroup

func (a *App) ExportGroup(ctx context.Context) error

ExportGroup will export all projects of the group.

func (*App) ExportProject

func (a *App) ExportProject(ctx context.Context, projectID int) error

ExportProject exports the project of the given ID.

func (*App) Run

func (a *App) Run(ctx context.Context) error

Run runs the app.

func (*App) SetGitlabEndpoint

func (a *App) SetGitlabEndpoint(gitlabAPIEndpoint string)

SetGitlabEndpoint sets the gitlab endpoint.

func (*App) SetLogger

func (a *App) SetLogger(l Logger)

SetLogger sets the logger.

func (*App) SetToken

func (a *App) SetToken(token string)

SetToken sets the gitlab token.

func (*App) StoreArchive

func (a *App) StoreArchive(ctx context.Context, archiveFilePath string) error

StoreArchive stores the archive.

type Logger

type Logger interface {
	Debug(msg string, args ...any)
	Warn(msg string, args ...any)
	Error(msg string, args ...any)
	Info(msg string, args ...any)
}

Logger interface defines the logging methods used by the application.

Jump to

Keyboard shortcuts

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