steamcmd

package module
v0.0.0-...-755f551 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 License: MIT Imports: 22 Imported by: 1

README

go-steamcmd CI godoc goreportcard

Go module download and interact with Valve's Steam's steamcmd.

install

go get github.com/frantjc/go-steamcmd

use

See examples.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DownloadURL = func() *url.URL {
		u, err := url.Parse("https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz")
		if err != nil {
			panic(err)
		}

		return u
	}()
	DefaultPlatformType = PlatformTypeLinux
)
View Source
var Quit = &q{}

Functions

func Args

func Args(flags *Flags, commands ...Command) ([]string, error)

func Clean

func Clean() error

func Download

func Download(ctx context.Context) (io.ReadCloser, error)

func Run

func Run(ctx context.Context, cmds ...Command) error

Types

type AppInfo

type AppInfo struct {
	Common AppInfoCommon `vdf:"common"`
	Config AppInfoConfig `vdf:"config"`
	Depots AppInfoDepots `vdf:"depots"`
}

func GetAppInfo

func GetAppInfo(appID int) (*AppInfo, bool)

GetAppInfo returns the app info for the given app ID, assuming that steamcmd has previously ran AppInfoPrint for the given app ID.

type AppInfoCommon

type AppInfoCommon struct {
	Name       string `vdf:"name"`
	Type       string `vdf:"type"`
	Parent     int    `vdf:"parent"`
	OSList     string `vdf:"oslist"`
	GameID     int    `vdf:"gameid"`
	OSArch     string `vdf:"osarch"`
	Icon       string `vdf:"icon"`
	LogoSmall  string `vdf:"logo_small"`
	ClientIcon string `vdf:"clienticon"`
}

type AppInfoConfig

type AppInfoConfig struct {
	Launch      map[string]AppInfoConfigLaunch `vdf:"launch"`
	ContentType string                         `vdf:"contenttype"`
	InstallDir  string                         `vdf:"installdir"`
}

type AppInfoConfigLaunch

type AppInfoConfigLaunch struct {
	Executable string                     `vdf:"executable"`
	Arguments  string                     `vdf:"arguments"`
	Type       string                     `vdf:"type"`
	Config     *AppInfoConfigLaunchConfig `vdf:"config"`
}

type AppInfoConfigLaunchConfig

type AppInfoConfigLaunchConfig struct {
	OSList string `vdf:"oslist"`
	OSArch string `vdf:"osarch"`
}

type AppInfoDepots

type AppInfoDepots struct {
	Branches map[string]AppInfoDepotsBranch `vdf:"branches"`
}

type AppInfoDepotsBranch

type AppInfoDepotsBranch struct {
	BuildID     int    `vdf:"buildid"`
	Description string `vdf:"description"`
	TimeUpdated int    `vdf:"timeupdated"`
	PwdRequired bool   `vdf:"pwdrequired"`
}

type AppInfoPrint

type AppInfoPrint int

func (AppInfoPrint) Args

func (c AppInfoPrint) Args() ([]string, error)

func (AppInfoPrint) Check

func (c AppInfoPrint) Check(flags *Flags) error

func (AppInfoPrint) Modify

func (c AppInfoPrint) Modify(_ *Flags) error

func (AppInfoPrint) String

func (c AppInfoPrint) String() string

type AppInfoRequest

type AppInfoRequest int

func (AppInfoRequest) Args

func (c AppInfoRequest) Args() ([]string, error)

func (AppInfoRequest) Check

func (c AppInfoRequest) Check(flags *Flags) error

func (AppInfoRequest) Modify

func (c AppInfoRequest) Modify(_ *Flags) error

func (AppInfoRequest) String

func (c AppInfoRequest) String() string

type AppUpdate

type AppUpdate struct {
	AppID        int
	Beta         string
	BetaPassword string
	Validate     bool
}

func (AppUpdate) Args

func (c AppUpdate) Args() ([]string, error)

func (AppUpdate) Check

func (AppUpdate) Check(flags *Flags) error

func (AppUpdate) Modify

func (c AppUpdate) Modify(_ *Flags) error

type Command

type Command interface {
	Check(*Flags) error
	Args() ([]string, error)
	Modify(*Flags) error
}

type CommandError

type CommandError struct {
	Err    error
	Msg    string
	Output []byte
}

func (*CommandError) Error

func (e *CommandError) Error() string

func (*CommandError) Unwrap

func (e *CommandError) Unwrap() error

type Flags

type Flags struct {
	LoggedIn bool
}

type ForceInstallDir

type ForceInstallDir string

func (ForceInstallDir) Args

func (c ForceInstallDir) Args() ([]string, error)

func (ForceInstallDir) Check

func (ForceInstallDir) Check(flags *Flags) error

func (ForceInstallDir) Modify

func (c ForceInstallDir) Modify(_ *Flags) error

func (ForceInstallDir) String

func (c ForceInstallDir) String() string

type ForcePlatformType

type ForcePlatformType PlatformType

func (ForcePlatformType) Args

func (c ForcePlatformType) Args() ([]string, error)

func (ForcePlatformType) Check

func (c ForcePlatformType) Check(_ *Flags) error

func (ForcePlatformType) Modify

func (c ForcePlatformType) Modify(_ *Flags) error

func (ForcePlatformType) String

func (c ForcePlatformType) String() string

type Login

type Login struct {
	Username       string
	Password       string
	SteamGuardCode string
}

func (Login) Args

func (c Login) Args() ([]string, error)

func (Login) Check

func (c Login) Check(_ *Flags) error

func (Login) Modify

func (Login) Modify(flags *Flags) error

type Path

type Path string

func New

func New(ctx context.Context) (Path, error)

func (Path) Run

func (c Path) Run(ctx context.Context, commands ...Command) error

func (Path) Start

func (c Path) Start(ctx context.Context, commands ...Command) (*Prompt, error)

func (Path) String

func (c Path) String() string

type PlatformType

type PlatformType string
var (
	PlatformTypeWindows PlatformType = "windows"
	PlatformTypeLinux   PlatformType = "linux"
	PlatformTypeMacOS   PlatformType = "macos"
)

func (PlatformType) String

func (t PlatformType) String() string

type Prompt

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

func Start

func Start(ctx context.Context, cmds ...Command) (*Prompt, error)

func (*Prompt) Close

func (p *Prompt) Close() error

func (*Prompt) Run

func (p *Prompt) Run(ctx context.Context, commands ...Command) error

type WorkshopDownloadItem

type WorkshopDownloadItem struct {
	AppID           int
	PublishedFileID int
}

func (WorkshopDownloadItem) Args

func (c WorkshopDownloadItem) Args() ([]string, error)

func (WorkshopDownloadItem) Check

func (WorkshopDownloadItem) Check(flags *Flags) error

func (WorkshopDownloadItem) Modify

func (c WorkshopDownloadItem) Modify(_ *Flags) error

func (WorkshopDownloadItem) String

func (c WorkshopDownloadItem) String() string

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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