workshop

package
v0.0.0-...-cca5969 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package workshop has been designed to prepare a mod directory or archive for Steam Workshop. It allows including only the essential files based on ignore list. In the future, it may also include the features to automatically publish your mod.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	SetIgnore([]string)
	IsPathIgnored(string) bool
	GetFiles() ([]string, int64, error)
	DestDirExists() bool
	MakeDestDir() error
	MakeDestFile(string) error
	CopyFiles() error
	ZipFiles() error
	CountDestItems() (int, error)
	Files() []string
	FilesSize() int64
	RelSrcPath() string
	AbsSrcPath() string
	RelDestPath() string
	AbsDestPath() string
	PrintFiles()
}

Controller is the interface that wraps the Workshop methods.

type Workshop

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

Workshop represents a workshop-related data.

func New

func New(src, dest string) (*Workshop, error)

New creates a new Workshop instance.

func (*Workshop) AbsDestPath

func (w *Workshop) AbsDestPath() string

AbsDestPath gets an absolute destination path.

func (*Workshop) AbsSrcPath

func (w *Workshop) AbsSrcPath() string

AbsSrcPath gets an absolute source path.

func (*Workshop) CopyFiles

func (w *Workshop) CopyFiles() error

CopyFiles copies all files retrieved earlier using GetFiles to the destination path.

func (*Workshop) CountDestItems

func (w *Workshop) CountDestItems() (int, error)

CountDestItems counts the total number of items within a destination directory.

func (*Workshop) DestDirExists

func (w *Workshop) DestDirExists() bool

DestDirExists checks if destination directory exists.

func (*Workshop) Files

func (w *Workshop) Files() []string

Files gets a list of files retrieved earlier using GetFiles.

func (*Workshop) FilesSize

func (w *Workshop) FilesSize() int64

FilesSize gets the total size of all files retrieved earlier using GetFiles.

func (*Workshop) GetFiles

func (w *Workshop) GetFiles() ([]string, int64, error)

GetFiles gets a list of files and their size in total from the source path based on ignore list.

func (*Workshop) IsPathIgnored

func (w *Workshop) IsPathIgnored(path string) bool

IsPathIgnored checks if the provided path is ignored.

func (*Workshop) MakeDestDir

func (w *Workshop) MakeDestDir() error

MakeDestDir makes an empty destination directory.

func (*Workshop) MakeDestFile

func (w *Workshop) MakeDestFile(name string) error

MakeDestFile makes an empty destination file.

func (*Workshop) PrintFiles

func (w *Workshop) PrintFiles()

PrintFiles prints a list of files retrieved earlier using GetFiles.

func (*Workshop) RelDestPath

func (w *Workshop) RelDestPath() string

RelDestPath gets a relative destination path.

func (*Workshop) RelSrcPath

func (w *Workshop) RelSrcPath() string

RelSrcPath gets a relative source path.

func (*Workshop) SetIgnore

func (w *Workshop) SetIgnore(ignore []string)

SetIgnore sets ignore list.

func (*Workshop) ZipFiles

func (w *Workshop) ZipFiles() error

ZipFiles create an archive of all files retrieved earlier using GetFiles.

Jump to

Keyboard shortcuts

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