Documentation ¶
Index ¶
- func CastResourceToStorageResource(r Resource, v uint64) storage.Resource
- func CloneResourceRepo(ctx context.Context, res, clone Resource) (vcs.VCS, *gz.ErrMsg)
- func CreateResourceRepo(ctx context.Context, res Resource, filesPath string) (vcs.VCS, *gz.ErrMsg)
- func DownloadZipFile(ctx context.Context, resource Resource, kind string, version int) (string, error)
- func FileTree(ctx context.Context, res Resource, version string) (*fuel.FileTree, *gz.ErrMsg)
- func GetFile(ctx context.Context, res Resource, path, version string) (*[]byte, int, *gz.ErrMsg)
- func GetLatestVersion(ctx context.Context, res Resource) (int, error)
- func GetRevisionFromVersion(ctx context.Context, res Resource, version string) (string, int, *gz.ErrMsg)
- func GetThumbnails(res Resource) (tbns []string, err error)
- func GetZip(ctx context.Context, res Resource, subfolder string, version string) (*string, int, *gz.ErrMsg)
- func MoveResource(resource Resource, destOwner string) *gz.ErrMsg
- func QueryForResourceVisibility(tx, q *gorm.DB, owner *string, user *users.User) *gorm.DB
- func Remove(tx *gorm.DB, res Resource, user string) *gz.ErrMsg
- func ZipResourceTip(ctx context.Context, repo vcs.VCS, res Resource, subfolder string) (int64, string, *gz.ErrMsg)
- type GetZipResource
- type Metadata
- type Metadatum
- type Resource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CastResourceToStorageResource ¶
CastResourceToStorageResource creates a new storage.Resource for the given resource associated to the given version.
func CloneResourceRepo ¶
CloneResourceRepo clones the VCS repository of a given resource. Returns the VCS respository of the clone.
func CreateResourceRepo ¶
CreateResourceRepo creates the VCS repository for a given resource Returns the created VCS repository.
func DownloadZipFile ¶
func DownloadZipFile(ctx context.Context, resource Resource, kind string, version int) (string, error)
DownloadZipFile allows to serve a file directly, it returns the path to the zip file from the EFS drive. This method was added for backward compatibility with fuel clients that don't support redirects nor links to cloud providers.
func GetFile ¶
GetFile returns the contents (bytes) of a resource file. Given version is considered. Returns the file's bytes and the resolved version of the resource.
func GetLatestVersion ¶
GetLatestVersion gets the latest version number of a file based resource.
func GetRevisionFromVersion ¶
func GetRevisionFromVersion(ctx context.Context, res Resource, version string) (string, int, *gz.ErrMsg)
GetRevisionFromVersion finds the revision hash from a given resource version. Version 1 is the initial version of the resource when the repo was created or cloned. Returns the found revision, the resolved version or an error.
func GetThumbnails ¶
GetThumbnails returns a slice of urls pointing to the thumbnails.
func GetZip ¶
func GetZip(ctx context.Context, res Resource, subfolder string, version string) (*string, int, *gz.ErrMsg)
GetZip returns a path to the existing resource zip for the given version. It creates the zip if it does not exist. subfolder arg is the resource type folder for the user (eg. models, worlds)
func MoveResource ¶
MoveResource will move a resource's on-disk location from sourceOwner to destOwner.
func QueryForResourceVisibility ¶
QueryForResourceVisibility checks the relationship between requestor (user) and the resource owner to formulate a database query to determine whether a resource is visible to the user
func Remove ¶
Remove removes a resource. The user argument is the requesting user. It is used to check if the user can perform the operation.
func ZipResourceTip ¶
func ZipResourceTip(ctx context.Context, repo vcs.VCS, res Resource, subfolder string) (int64, string, *gz.ErrMsg)
ZipResourceTip creates a new zip file for the given resource. Returns the zip Filesize and the path to the given zip file or an error. subfolder arg is the resource type folder for the user (eg. models, worlds)
Types ¶
type GetZipResource ¶
type GetZipResource func(ctx context.Context, resource Resource, kind string, version int) (string, error)
GetZipResource defines a function that allows getting a zip file from a local or remote location.
func GetZipLink ¶
func GetZipLink(storage storage.Storage) GetZipResource
GetZipLink allows to get the link to a zip file.
type Metadatum ¶
type Metadatum struct { // Key is the string containing the metadata key value. Key *string `json:"key,omitempty"` // Value is the string containing the metadata value associated with the key. Value *string `json:"value,omitempty"` }
Metadatum contains a key-value pair for a resources.
swagger:model dbModel