Documentation ¶
Index ¶
- Variables
- func AdminMiddleware(next http.Handler) http.Handler
- func CategorizeCommitDate(date time.Time) string
- func ComparePassword(r, u string) error
- func CustomJSONEncoder(v interface{}) (string, error)
- func DeleteDir(dirName string) error
- func DeleteToken(key string) error
- func ErrorJSONResponse(w http.ResponseWriter, status int, err error)
- func GeneratePassword(user *model.User) error
- func GenerateToken(id string, isAdmin bool) (string, error)
- func GenerateULID() string
- func GetCharacterLength(character string) int
- func GetDateOnly() string
- func GetDay() string
- func GetMorph(sentence string) (model.MorphResponse, error)
- func GetQueryParam(r *http.Request, key string, required bool) (string, error)
- func GetToken(key string) (string, error)
- func IsDateAfter(date1, date2 time.Time) bool
- func IsDateBefore(date1, date2 time.Time) bool
- func Iso8601ToDate(t string) (time.Time, error)
- func JwtMiddleware(next http.Handler) http.Handler
- func LoadImage(data []byte, fileType string) (image.Image, error)
- func LoadPrivateKeyFromEnv()
- func Logger() *slog.Logger
- func MakeDir(dirName string) error
- func Md2HTML(content string) string
- func ParseFields(fields string) ([]string, error)
- func ReadFormFile(r *http.Request) (*bytes.Buffer, string, int64, error)
- func Resize(data []byte, maxHeight int) (*bytes.Buffer, int64)
- func SaveFile(data []byte, path string, extension string) (string, error)
- func SaveToken(key, token string) error
- func SuccessJSONResponse(w http.ResponseWriter, res interface{})
- func SuccessJSONResponseWithoutEscape(w http.ResponseWriter, res interface{})
- func URLDecode(s string) (string, error)
- func ValidateFileType(r *http.Request) (string, error)
- func ValidateMaxFileSize(r *http.Request) error
- func ValidateToken(ctx context.Context, tokenString string) (context.Context, error)
- type Token
Constants ¶
This section is empty.
Variables ¶
View Source
var (
TokenKey = &tokenContextKey{}
)
Functions ¶
func CategorizeCommitDate ¶
CategorizeCommitDate は、コミットの日付をカテゴリに分類します。 優先度: Today > This Week > This Month > Q1 Q2 Q3 Q4 > Older
func ComparePassword ¶
func CustomJSONEncoder ¶
func DeleteToken ¶
func ErrorJSONResponse ¶
func ErrorJSONResponse(w http.ResponseWriter, status int, err error)
func GeneratePassword ¶
func GeneratePassword(user *model.User) error
func GetCharacterLength ¶
func GetDateOnly ¶
func GetDateOnly() string
func IsDateAfter ¶
IsDateAfter は date1 の日付が date2 の日付より後かどうかを判定します。 日付が同じであれば、false.
func IsDateBefore ¶
IsDateBefore は date1 の日付が date2 の日付より前かどうかを判定します。 日付が同じであれば、false.
func LoadPrivateKeyFromEnv ¶
func LoadPrivateKeyFromEnv()
func ParseFields ¶
func SuccessJSONResponse ¶
func SuccessJSONResponse(w http.ResponseWriter, res interface{})
func SuccessJSONResponseWithoutEscape ¶
func SuccessJSONResponseWithoutEscape(w http.ResponseWriter, res interface{})
func ValidateMaxFileSize ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.