Documentation ¶
Index ¶
- func CloneResourceRepo(ctx context.Context, res, clone Resource) (vcs.VCS, *ign.ErrMsg)
- func CreateResourceRepo(ctx context.Context, res Resource, filesPath string) (vcs.VCS, *ign.ErrMsg)
- func FileTree(ctx context.Context, res Resource, version string) (*fuel.FileTree, *ign.ErrMsg)
- func GetFile(ctx context.Context, res Resource, path, version string) (*[]byte, int, *ign.ErrMsg)
- func GetLatestVersion(ctx context.Context, res Resource) (int, error)
- func GetRevisionFromVersion(ctx context.Context, res Resource, version string) (string, int, *ign.ErrMsg)
- func GetThumbnails(res Resource) (tbns []string, err error)
- func GetZip(ctx context.Context, res Resource, subfolder string, version string) (*string, int, *ign.ErrMsg)
- func QueryForResourceVisibility(tx, q *gorm.DB, owner *string, user *users.User) *gorm.DB
- func Remove(tx *gorm.DB, res Resource, user string) *ign.ErrMsg
- func ZipResourceTip(ctx context.Context, repo vcs.VCS, res Resource, subfolder string) (int64, *ign.ErrMsg)
- type Resource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 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, *ign.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, *ign.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 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, *ign.ErrMsg)
ZipResourceTip creates a new zip file for the given resource. Returns the zip Filesize or an error. subfolder arg is the resource type folder for the user (eg. models, worlds)