prefabservice

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const DOWNLOADING string = ""
View Source
const LONG_ENOUGH = time.Duration(1000000 * time.Hour)
View Source
const NEVER_OUTDATE = time.Duration(math.MaxInt64)

Variables

This section is empty.

Functions

func DecodeAnyEnvSpec added in v0.2.2

func DecodeAnyEnvSpec(repoType string, envSpec string) (repointerface.EnvSpec, error)

func DecodeAnySpecifier added in v0.2.2

func DecodeAnySpecifier(repoType string, specifier string) (repointerface.Constraint, error)

func DecodeSpecSheet added in v0.2.2

func DecodeSpecSheet(raw []byte) (spec repointerface.SpecSheet, err error)

func NormalizeAnyName added in v0.2.2

func NormalizeAnyName(repoType string, name string) string

func ParseAnyVersion added in v0.2.2

func ParseAnyVersion(repoType string, version string) (repointerface.Version, error)

func PostSpecSheet

func PostSpecSheet(baseURL string, specSheet repointerface.SpecSheet) (prefabID string, blueprintID string, err error)

Types

type FileInfo

type FileInfo struct {
	FileName string `json:"filename"`
	FileType string `json:"filetype"`
	FileSize uint64 `json:"filesize"`
}

type FileStore

type FileStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewFileStore

func NewFileStore(workDir string) (fileStore *FileStore, err error)

func (*FileStore) AddFile

func (f *FileStore) AddFile(file io.ReadCloser, targetPath string, id string, fileInfo FileInfo, unpack bool, waitFinish bool) (err error)

func (*FileStore) DeleteFile

func (f *FileStore) DeleteFile(id string) (err error)

func (*FileStore) NewFile

func (f *FileStore) NewFile(path string, fileType string) (id string, err error)

func (*FileStore) WaitDownload

func (f *FileStore) WaitDownload(ids []string) (err error)

type InfoStore

type InfoStore struct {
	Repos map[string]*RepoInfo `json:"repos"`

	sync.RWMutex
	// contains filtered or unexported fields
}

func NewInfoStore

func NewInfoStore(workDir string, ttl time.Duration) (infoStore *InfoStore, err error)

func (*InfoStore) DeleteItem

func (i *InfoStore) DeleteItem(repo string, name string, version string, environment string) (err error)

func (*InfoStore) GetEnvironments

func (i *InfoStore) GetEnvironments(repo string, name string, version string) (environments []string, outdated bool)

func (*InfoStore) GetItem

func (i *InfoStore) GetItem(repo string, name string, version string, environment string) (prefabID, blueprintID string)

func (*InfoStore) GetNames

func (i *InfoStore) GetNames(repo string) (names []string, outdated bool)

func (*InfoStore) GetVersions

func (i *InfoStore) GetVersions(repo string, name string) (versions []string, outdated bool)

func (*InfoStore) SetEnvironments

func (i *InfoStore) SetEnvironments(repo string, name string, version string, environments []string) (err error)

func (*InfoStore) SetItem

func (i *InfoStore) SetItem(repo string, name string, version string, environment string, prefabID string, blueprintID string) (err error)

func (*InfoStore) SetNames

func (i *InfoStore) SetNames(repo string, names []string) (err error)

func (*InfoStore) SetVersions

func (i *InfoStore) SetVersions(repo string, name string, versions []string) (err error)

type ItemInfo

type ItemInfo struct {
	PrefabID    string `json:"prefab"`
	BlueprintID string `json:"blueprint"`
}

type NameInfo

type NameInfo struct {
	Versions   map[string]*VersionInfo `json:"versions"`
	UpdateTime time.Time               `json:"update"`
}

type PrefabService

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

func NewPrefabService

func NewPrefabService(workDir string, upstream string, fabricatePrefab bool, unpackPrefab bool, logging bool, ttl time.Duration) (ps *PrefabService, err error)

func NewProxyService

func NewProxyService(workDir string, upstream string) (ps *PrefabService, err error)

func NewServerService

func NewServerService(workDir string) (ps *PrefabService, err error)

func NewUserService

func NewUserService(workDir string, upstream string) (ps *PrefabService, err error)

func (*PrefabService) GetUpstreamEnvironemnts

func (ps *PrefabService) GetUpstreamEnvironemnts(repository string, name string, version string) (environments []string, err error)

func (*PrefabService) GetUpstreamFile

func (ps *PrefabService) GetUpstreamFile(id string) (file io.ReadCloser, fileName string, fileType string, err error)

func (*PrefabService) GetUpstreamItem

func (ps *PrefabService) GetUpstreamItem(repository string, name string, version string, environment string) (prefabID string, blueprintID string, err error)

func (*PrefabService) GetUpstreamNames

func (ps *PrefabService) GetUpstreamNames(repository string) (names []string, err error)

func (*PrefabService) GetUpstreamVersions

func (ps *PrefabService) GetUpstreamVersions(repository string, name string) (versions []string, err error)

func (*PrefabService) HandleDeleteItem

func (ps *PrefabService) HandleDeleteItem(repository string, name string, version string, environment string) (err error)

func (*PrefabService) HandleGetEnvironments

func (ps *PrefabService) HandleGetEnvironments(repository string, name string, version string) (environments []string, err error)

func (*PrefabService) HandleGetFile

func (ps *PrefabService) HandleGetFile(id string) (path string, fileName string, fileType string, err error)

func (*PrefabService) HandleGetItem

func (ps *PrefabService) HandleGetItem(repository, name, version, environment string) (prefabID, blueprintID string, err error)

func (*PrefabService) HandleGetNames

func (ps *PrefabService) HandleGetNames(repository string) (names []string, err error)

func (*PrefabService) HandleGetVersions

func (ps *PrefabService) HandleGetVersions(repository string, name string) (versions []string, err error)

func (*PrefabService) HandleList

func (p *PrefabService) HandleList(writer io.Writer) (err error)

func (*PrefabService) HandlePostSpecSheet

func (ps *PrefabService) HandlePostSpecSheet(specSheet []byte) (prefabID string, blueprintID string, err error)

func (*PrefabService) HandlePostUpload

func (ps *PrefabService) HandlePostUpload(repository, prefabPath, blueprintPath, fileType string) (prefabID, blueprintID string, err error)

func (*PrefabService) PostUpload added in v0.2.2

func (ps *PrefabService) PostUpload(repository string, prefabPath string, blueprintPath string) error

func (*PrefabService) PostUpstreamSpecSheet

func (ps *PrefabService) PostUpstreamSpecSheet(specSheet repointerface.SpecSheet) (prefabID string, blueprintID string, err error)

func (*PrefabService) PrefabSelection

func (ps *PrefabService) PrefabSelection(specSheet repointerface.SpecSheet) (prefabID string, blueprintID string, err error)

func (*PrefabService) RequestBlueprint

func (ps *PrefabService) RequestBlueprint(repoType string, name string, specifier repointerface.Constraint, ctx *dcontext.DeployContext) (blueprint *prefab.Blueprint, blueprintID string, prefabID string, err error)

func (*PrefabService) RequestClosure added in v0.2.2

func (ps *PrefabService) RequestClosure(name string, version string, dstDir string) (closureName string, err error)

func (*PrefabService) RequestPrefabBlueprint

func (ps *PrefabService) RequestPrefabBlueprint(blueprintID string, prefabID string) (blueprint prefab.Blueprint, prefabPath string, err error)

func (*PrefabService) SizeSum added in v0.2.3

func (ps *PrefabService) SizeSum(ids []string) (size uint64, err error)

func (*PrefabService) WaitDownload

func (ps *PrefabService) WaitDownload(ids []string) error

type RepoInfo

type RepoInfo struct {
	Names      map[string]*NameInfo `json:"names"`
	UpdateTime time.Time            `json:"update"`
}

type VersionInfo

type VersionInfo struct {
	Environments map[string]*ItemInfo `json:"environments"`
	UpdateTime   time.Time            `json:"update"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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