Documentation ¶
Index ¶
- Constants
- Variables
- func LogExec(log Logger, cmd *exec.Cmd)
- func SemVer() string
- func WithLogger(ctx context.Context, log Logger) context.Context
- type Logger
- type Metadata
- type ModMetadata
- type Opt
- type Sindri
- func (s *Sindri) AddMods(ctx context.Context, mods ...string) error
- func (s *Sindri) AppUpdate(ctx context.Context) error
- func (s *Sindri) Extract(mods ...string) (io.ReadCloser, error)
- func (s *Sindri) ExtractMods(mods ...string) (io.ReadCloser, error)
- func (s *Sindri) Mods() ([]thunderstore.Package, error)
- func (s *Sindri) RemoveMods(_ context.Context, mods ...string) error
Constants ¶
const ( // ImageRef is the image reference that Sindri // stores a game and its mods' files at inside // of it's .tar file. ImageRef = "frantj.cc/sindri" // MetadataLayerDigestLabel is the image config file label // that Sindri stores Metadata at. MetadataLayerDigestLabel = "cc.frantj.sindri.metadata-layer-digest" )
Variables ¶
var VersionCore = "1.3.2"
VersionCore is the SemVer version core of sindri. Meant to be be overridden at build time, but kept up-to-date sometimes to best support `go install`.
Functions ¶
Types ¶
type Logger ¶
Logger is an alias to logr.Logger in case the logging library is desired to be swapped out.
func LoggerFrom ¶
LoggerFrom returns a Logger embedded within the given Context or a no-op Logger if no such Logger exists.
type Metadata ¶
type Metadata struct { SteamAppLayerDigest string `json:"steamAppLayerDigest,omitempty"` Mods map[string]ModMetadata `json:"mods,omitempty"` }
Metadata stores metadata about a downloaded game and added mods.
type ModMetadata ¶
type ModMetadata struct { LayerDigest string `json:"layerDigest,omitempty"` Version string `json:"version,omitempty"` }
ModMetadata stores metadata about an added mod.
type Opt ¶
type Opt func(*Sindri)
Opt is an option to pass when creating a new Sindri instance.
func WithRootDir ¶
WithRootDir sets a *Sindri's root directory where it will store any persistent data.
func WithStateDir ¶
WithStateDir sets a *Sindri's state directory where it will store any ephemeral data.
type Sindri ¶
type Sindri struct { SteamAppID string BepInEx *thunderstore.Package ThunderstoreClient *thunderstore.Client // contains filtered or unexported fields }
Sindri manages the files of a game and its mods.
func New ¶
func New(steamAppID string, bepInEx *thunderstore.Package, thunderstoreClient *thunderstore.Client, opts ...Opt) (*Sindri, error)
New creates a new Sindri instance with the given required arguments and options. Sindri can also be safely created directly so long as the exported fields are set to non-nil values.
func (*Sindri) AddMods ¶ added in v0.6.4
AddMods installs or updates the given mods and their dependencies using thunderstore.io.
func (*Sindri) AppUpdate ¶
AppUpdate uses `steamcmd` to installed or update the game that *Sindri is managing.
func (*Sindri) Extract ¶
func (s *Sindri) Extract(mods ...string) (io.ReadCloser, error)
Extract returns an io.ReadCloser of a tarball containing the files of the game and the given mods.
func (*Sindri) ExtractMods ¶
func (s *Sindri) ExtractMods(mods ...string) (io.ReadCloser, error)
ExtractMods returns an io.ReadCloser containing a tarball containing the files just the game's mods.