steammesh

package
v0.0.0-...-cc691f3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StatusQueued Copy is queued to run when possible
	StatusQueued CopierStatus = "Queued"
	// StatusRunning Copy is running
	StatusRunning = "Running"
	// StatusCalculating Copy is running but is still counting files which must be copied
	StatusCalculating = "Calculating"
	// StatusSuccessful Copy has finished and completed successfully
	StatusSuccessful = "Successful"
	// StatusFailed Copy has finished and failed
	StatusFailed = "Failed"
)
View Source
const DefaultPort = 9771
View Source
const IOBufferSize int = 1e+6

Buffer size in bytes (1 MegaByte)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI() *API

func (*API) GetPeers

func (i *API) GetPeers() []Peer

func (*API) SetConfig

func (i *API) SetConfig(config Config) (err error)

type Action

type Action int
const (
	ActionWrite Action = iota
	ActionDelete
)

type Config

type Config struct {
	Peers []Peer `json:"peers"`
}

type CopierStatus

type CopierStatus string

CopierStatus Indicates the status of a GameCopier operation

type GameCopier

type GameCopier struct {
	Status     CopierStatus `json:"status"`
	AppID      int          `json:"appid"`
	BytesDone  int64        `json:"bytes_done"`
	BytesTotal int64        `json:"bytes_total"`
	Files      int          `json:"files"`
	Peer       Peer         `json:"peer"`
	Dest       string       `json:"dest"`
	Steam      *steam.API
}

GameCopier operation. Copies games between a peer and the local host

func (*GameCopier) CopyGameFrom

func (g *GameCopier) CopyGameFrom() (err error)

CopyGameFrom Start copying the game using the pre configured parameters

func (*GameCopier) CopyHeaderImageFrom

func (g *GameCopier) CopyHeaderImageFrom() error

func (*GameCopier) CopyManifestFrom

func (g *GameCopier) CopyManifestFrom() (err error)

func (*GameCopier) DiffDirectory

func (g *GameCopier) DiffDirectory(remoteURL *url.URL, item *SyncItem) (items []*SyncItem, err error)

DiffDirectory Get the difference between a remote path and local directory

func (*GameCopier) DownloadItem

func (g *GameCopier) DownloadItem(remoteURL *url.URL, item *SyncItem) (err error)

DownloadItem downloads a file from a HTTP endpoint

func (*GameCopier) StartCopy

func (g *GameCopier) StartCopy()

StartCopy wait for locks and start copying the game

type Peer

type Peer struct {
	Name  string                 `json:"name"`
	Proxy *httputil.ReverseProxy `json:"-"`
}

func (*Peer) Url

func (p *Peer) Url() (url *url.URL)

type SyncItem

type SyncItem struct {
	TransferItem
	Action Action `json="action"`
}

type TransferItem

type TransferItem struct {
	Path  string      `json="path"`
	Mtime time.Time   `json="mtime"`
	Mode  os.FileMode `json="mode"`
	Size  int64       `json="size"`
}

Jump to

Keyboard shortcuts

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