common

package
v0.0.0-...-41aeeaa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultImageUuid = pgtype.UUID{
	Bytes: [16]byte{},
	Valid: true,
}

Functions

func CreateUniqueFileName

func CreateUniqueFileName(file string) string

func FileMimeFrom

func FileMimeFrom(fileName string) string

func HasRegexSpecialChars

func HasRegexSpecialChars(input string) bool

func IsEnv

func IsEnv(env constants.Environment) bool

Types

type News

type News struct {
	ID      int32  `json:"id"`
	Title   string `json:"title"`
	Content string `json:"content"`
	ImageID string `json:"image_id"`
}

func GetNews

func GetNews(id int32) (*News, error)

type NewsInfo

type NewsInfo struct {
	ID      int32  `json:"id"`
	Title   string `json:"title"`
	ImageID string `json:"image_id"`
}

func GetNewsInfo

func GetNewsInfo() []NewsInfo

type QueryParams

type QueryParams struct {
	Offset int64 `query:"offset"` // the start index of the query
	Limit  int64 `query:"limit"`  // the number of the query
}

func NewQueryParams

func NewQueryParams(offset int64, limit int64) QueryParams

func (*QueryParams) Validate

func (q *QueryParams) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL