package
module
Version:
v0.0.0-...-1ff1beb
Opens a new window with list of versions in this module.
Published: Oct 30, 2022
License: MIT
Opens a new window with license information.
Imports: 10
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Some examples of a reusable module from the course on Go modules.
Included tools:
- Read JSON
- Write JSON
- Produce JSON encoded error messages
- Upload files
- Download file
- Generate random string of length n
- Post JSON to remove service
- Create dir, with parent dirs if they don't exist
- Create URL safe slug
Installation
go get -u https://github.com/sanjib/tsawler-toolkit
Documentation
¶
RandomString generates a base32 random string of n size.
type Tools struct {
MaxFileSize int
AllowedFileTypes []string
}
Tools is the type that allows access to its various utility methods.
RandomString generates a random string from randomStringSource of n size.
type UploadedFile struct {
NewFileName string
OriginalFileName string
FileSize int64
}
UploadedFile save information about the file to send back to user.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.