client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREATE_REPLACED_RESOURCES    = "CREATE TABLE IF NOT EXISTS replaced_resources (path TEXT UNIQUE, mod_time BIGINT, data BLOB)"
	INSERT_REPLACED_RESOURCE     = "INSERT INTO replaced_resources VALUES (?, ?, ?)"
	QUERY_ALL_REPLACED_RESOURCES = "SELECT * FROM replaced_resources"
	QUERY_REPLACED_RESOURCE      = "SELECT * FROM replaced_resources WHERE path = ?"

	CREATE_ADDED_RESOURCES    = "CREATE TABLE IF NOT EXISTS added_resources (path TEXT UNIQUE PRIMARY KEY)"
	INSERT_ADDED_RESOURCE     = "INSERT INTO added_resources VALUES (?)"
	QUERY_ALL_ADDED_RESOURCES = "SELECT * FROM added_resources"
	QUERY_ADDED_RESOURCE      = "SELECT * FROM added_resources WHERE path = ?"
)
View Source
const (
	SteamHome = ".steam/steam/"
)

Variables

This section is empty.

Functions

func Contains

func Contains(clientDirectory, resource string) bool

func FindRecentProtonVersion added in v0.2.0

func FindRecentProtonVersion(dir string) (string, error)

func RemoveResource

func RemoveResource(clientDirectory string, path string) error

func WriteResource

func WriteResource(clientDirectory string, resource Resource) error

Types

type Cache

type Cache[T any] interface {
	Add(T) error
	Get(key string) (T, error)
	List() ([]T, error)
	Has(key string) bool
}

type Client

type Client interface {
	Path() string
	SetPath(path string) error
	IsValid() bool
	Start() (*exec.Cmd, error)

	MeetsPrerequisites() bool
}

func NewStandardClient

func NewStandardClient() Client

type Resource

type Resource struct {
	Path    string
	ModTime int64
	Data    []byte
}

func ReadResource

func ReadResource(clientDirectory, resource string) (Resource, error)

func (Resource) Time

func (resource Resource) Time() time.Time

type Resources

type Resources interface {
	Replacements() Cache[Resource]
	Additions() Cache[string]

	Close() error
}

func NewSqliteResources

func NewSqliteResources(path string) (Resources, error)

Jump to

Keyboard shortcuts

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