package
0.0.0-20250105043511-94de4912c224
Repository: https://github.com/cedrickchee/skel.git
Documentation: pkg.go.dev
# Functions
Create a helper function which returns a Models instance containing the mock models only.
For ease of use, we also add a New() method which returns a Models struct containing the initialized MovieModel and initialized UserModel.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ValidateTokenPlaintext checks that the plaintext token has been provided and is exactly 26 bytes long.
No description provided by the author
# Constants
Define constants for the token scope.
Define constants for the token scope.
Define constants for the token scope.
# Variables
No description provided by the author
No description provided by the author
Define a custom ErrRecordNotFound error.
Define an error that our UnmarshalJSON() method can return if we're unable to parse or convert the JSON string successfully.
Define a custom ErrRecordNotFound error.
# Structs
No description provided by the author
Metadata holds the pagination metadata.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Create a Models struct which wraps the MovieModel.
Annotate the Movie struct with struct tags to control how the keys appear in the JSON-encoded output.
Define a MovieModel struct type which wraps a sql.DB connection pool.
PermissionModel struct type which wraps a sql.DB connection pool.
Token holds the data for an individual token.
TokenModel struct wraps the connection pool.
User struct represents an individual user.
UserModel struct wraps the connection pool.
# Type aliases
Define a Permissions slice, which we will use to will hold the permission codes (like "movies:read" and "movies:write") for a single user.
Declare a custom Runtime type, which has the underlying type int32 (the same as our Movie struct field).