mirror of
https://github.com/the-second-city/faceclaimer.git
synced 2025-10-29 03:56:02 -07:00
Fix docstrings
This commit is contained in:
@ -51,8 +51,7 @@ func IsValidObjectId(oid string) bool {
|
||||
return err == nil
|
||||
}
|
||||
|
||||
// AbsPath combines base and path into the absolute path. If the absolute path
|
||||
// is not within the base path, it returns an error.
|
||||
// AbsPath combines base and path into an absolute path, returning an error if the result is outside base.
|
||||
func AbsPath(base, path string) (string, error) {
|
||||
absBase, err := filepath.Abs(base)
|
||||
if err != nil {
|
||||
|
||||
@ -61,8 +61,7 @@ without an internet connection.`,
|
||||
},
|
||||
}
|
||||
|
||||
// Execute adds all child commands to the root command and sets flags appropriately.
|
||||
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
||||
// Execute runs the root command. Called by main.main().
|
||||
func Execute() {
|
||||
err := rootCmd.Execute()
|
||||
if err != nil {
|
||||
|
||||
@ -25,7 +25,7 @@ func imageFromBytes(data []byte) (image.Image, error) {
|
||||
return image, err
|
||||
}
|
||||
|
||||
// SaveWebP converts the given image data to WebP and saves at dest. Recommend 90 quality.
|
||||
// SaveWebP converts image data to WebP format and saves it to dest with the specified quality (recommended: 90).
|
||||
func SaveWebP(data []byte, dest string, quality int) error {
|
||||
if checks.PathExists(dest) {
|
||||
return fmt.Errorf("Error: %s already exists", dest)
|
||||
|
||||
@ -215,6 +215,7 @@ func prepImageName(r UploadRequest) (string, error) {
|
||||
return strings.Join([]string{guild, user, charId, imageName}, "/"), nil
|
||||
}
|
||||
|
||||
// Run starts the HTTP server with the given configuration.
|
||||
func Run(baseURL, imagesDir string, port, quality int) {
|
||||
cfg := &Config{
|
||||
ImagesDir: imagesDir,
|
||||
|
||||
Reference in New Issue
Block a user