ngdp

package
v0.0.0-...-95cd7cf Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2017 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildConfig

type BuildConfig struct {
	Root ContentHash

	Install     ContentHash
	InstallSize uint64

	Download     ContentHash
	DownloadSize uint64

	Encoding     BuildConfigEncoding
	EncodingSize BuildConfigEncodingSize

	Patch       ContentHash
	PatchSize   uint64
	PatchConfig CDNHash
}

A BuildConfig contains information on the current root, install, and download files, as well as the encoding file, and the currently available patch.

type BuildConfigEncoding

type BuildConfigEncoding struct {
	ContentHash ContentHash
	CDNHash     CDNHash
}

A BuildConfigEncoding contains the content and CDN hashes of an encoding file.

type BuildConfigEncodingSize

type BuildConfigEncodingSize struct {
	UncompressedSize uint64
	CompressedSize   uint64
}

A BuildConfigEncodingSize contains the BLTE-encoded and raw sizes of the encoding file.

type CDNConfig

type CDNConfig struct {
	Archives     []CDNHash
	ArchiveGroup CDNHash

	PatchArchives     []CDNHash
	PatchArchiveGroup CDNHash
}

A CDNConfig contains information on the archives, which are used to bundle smaller files together on the CDN.

type CDNHash

type CDNHash hash

A CDNHash is usually an MD5 hash of the BLTE header of a data file. Blizzard uses these to generate filenames for storage on the CDN.

func (CDNHash) Equal

func (h CDNHash) Equal(o CDNHash) bool

func (CDNHash) Less

func (h CDNHash) Less(o CDNHash) bool

type CDNInfo

type CDNInfo struct {
	Name       Region
	Path       string
	Hosts      []string
	ConfigPath string // unknown purpose
}

A CDNInfo contains information on which CDNs hold data for which regions, as well as what path the data is stored under.

type ContentHash

type ContentHash hash

A ContentHash is an MD5 hash of the raw contents of a file, before it is BLTE-encoded. These must be looked up in the encoding table to get a CDNHash before files can be downloaded.

func (ContentHash) Equal

func (h ContentHash) Equal(o ContentHash) bool

func (ContentHash) Less

func (h ContentHash) Less(o ContentHash) bool

type ContentType

type ContentType string

A ContentType is a type of thing stored on the CDN.

Each separate content type is stored under a different directory.

const (
	ContentTypeConfig ContentType = "config"
	ContentTypeData   ContentType = "data"
	ContentTypePatch  ContentType = "patch"
)

The content types below are believed to be exhaustive.

type FilenameMapper

type FilenameMapper interface {
	ToContentHash(fn string) (h ContentHash, ok bool)
}

A FilenameMapper represents a way for mapping filenames to content hashes.

This might be implemented by a listfile, or MNDX, or any of the myriad other ways Blizzard has deigned to refer to files.

type ProgramCode

type ProgramCode string

A ProgramCode is a reference to a particular game or game release channel.

Blizzard tracks release and PTR as separate program codes, even though they usually refer to the same underlying CDN storage.

const (
	// ProgramHotS is the ProgramCode for Heroes of the Storm.
	ProgramHotS ProgramCode = "hero"

	// ProgramHotSTest is the ProgramCode for the PTR of Heroes of the Storm.
	ProgramHotSTest ProgramCode = "herot"
)

type Region

type Region string

A Region is a reference to a game region, and is used for finding the nearest CDNs.

In most cases, Akamai and Level3 are used anyway - China being the main exception.

const (
	RegionUnitedStates Region = "us"
	RegionEurope       Region = "eu"
	RegionChina        Region = "cn"
	RegionKorea        Region = "kr"
	RegionTaiwan       Region = "tw"
	RegionSingapore    Region = "sg"
)

The region codes below are all the ones used for Heroes of the Storm which are known at the time of writing.

type VersionInfo

type VersionInfo struct {
	Region        Region
	BuildConfig   CDNHash
	CDNConfig     CDNHash
	BuildID       int `configtable:"BuildId"`
	VersionsName  string
	ProductConfig CDNHash
}

A VersionInfo lists the current build and CDN config CDNHashes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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