Documentation ¶
Index ¶
- Constants
- Variables
- func CleanSourcePath(indexURL string) string
- func DownloadBytes(url string) ([]byte, error)
- func DownloadFile(url string, path string) error
- func FileExists(path string) bool
- func GetURLBase(url string) string
- func NewRemoteReader(url string, cache Store, shouldCache bool) *remoteReader
- func WriteBytes(data []byte, path string) error
- type Asset
- type AssetFetcher
- func (m *AssetFetcher) FetchMapBundle(ctx context.Context, needle string) ([]byte, error)
- func (m *AssetFetcher) FetchMapBytes(ctx context.Context, needle string) ([]byte, error)
- func (m *AssetFetcher) FindMap(needle string) *FoundMap
- func (m *AssetFetcher) GetMaps(skipRoot string) []SlimMap
- func (m *AssetFetcher) PollDownloads(ctx context.Context)
- type AssetSource
- type Bundle
- type FSRoot
- type FSStore
- type FetchResult
- type FoundMap
- type GameMap
- type Index
- type IndexAsset
- type Job
- type Mod
- type Model
- type PackagedRoot
- func (f *PackagedRoot) Exists(ctx context.Context, path string) bool
- func (f *PackagedRoot) GetID(index int) (string, error)
- func (f *PackagedRoot) IsFS() bool
- func (f *PackagedRoot) ReadAsset(ctx context.Context, id string) ([]byte, error)
- func (f *PackagedRoot) ReadFile(ctx context.Context, path string) ([]byte, error)
- func (f *PackagedRoot) Reference(ctx context.Context, path string) (string, error)
- func (f *PackagedRoot) Source() string
- type RedisCache
- type RedisStore
- type Root
- type SlimMap
- type Store
Constants ¶
View Source
const ( ASSET_KEY = "assets-%s" ASSET_EXPIRY = time.Duration(1 * time.Hour) )
Variables ¶
View Source
var Missing = fmt.Errorf("asset missing")
Functions ¶
func CleanSourcePath ¶
func DownloadBytes ¶
func DownloadFile ¶
func FileExists ¶
func GetURLBase ¶
func NewRemoteReader ¶
func WriteBytes ¶
Types ¶
type AssetFetcher ¶
type AssetFetcher struct {
// contains filtered or unexported fields
}
func NewAssetFetcher ¶
func (*AssetFetcher) FetchMapBundle ¶
func (*AssetFetcher) FetchMapBytes ¶
func (*AssetFetcher) FindMap ¶
func (m *AssetFetcher) FindMap(needle string) *FoundMap
func (*AssetFetcher) GetMaps ¶
func (m *AssetFetcher) GetMaps(skipRoot string) []SlimMap
func (*AssetFetcher) PollDownloads ¶
func (m *AssetFetcher) PollDownloads(ctx context.Context)
type AssetSource ¶
type FetchResult ¶
type FoundMap ¶
type FoundMap struct { Map *SlimMap Root *PackagedRoot // contains filtered or unexported fields }
type IndexAsset ¶
type Job ¶
type Job struct { Id string Result chan FetchResult }
type PackagedRoot ¶
type PackagedRoot struct { // FS path -> asset id FS map[string]int // contains filtered or unexported fields }
func NewPackagedRoot ¶
func (*PackagedRoot) IsFS ¶ added in v0.2.0
func (f *PackagedRoot) IsFS() bool
func (*PackagedRoot) Source ¶ added in v0.2.0
func (f *PackagedRoot) Source() string
type RedisCache ¶
type RedisCache struct { *RedisStore // contains filtered or unexported fields }
func NewRedisCache ¶
func NewRedisCache(client *redis.Client, ttl time.Duration) *RedisCache
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
func NewRedisStore ¶
func NewRedisStore(client *redis.Client) *RedisStore
Click to show internal directories.
Click to hide internal directories.