models

package
v0.0.0-...-81a0211 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ModelsToAutoMigrate = []interface{}{
	&NewLinkEvent{}, &ClickEvent{},
}

Functions

This section is empty.

Types

type ClickEvent

type ClickEvent struct {
	gorm.Model
	Key    string
	Value  string
	UserIP string
}

type Config

type Config struct {
	DEVELOPMENT_MODE string `mapstructure:"development_mode" json:"development_mode"`
	WEB_PORT         string `mapstructure:"web_port" json:"web_port"`
	PRODUCTION_CORS  string `mapstructure:"production_cors" json:"production_cors"`

	KVSTORE_TYPE string `mapstructure:"kvstore_type" json:"kvstore_type"`
	// time to live in hours, 0 means no ttl
	DEFAULT_TTL int `mapstructure:"default_ttl" json:"default_ttl"`

	REDIS_ADDR   string `mapstructure:"redis_addr" json:"redis_addr"`
	REDIS_PWD    string `mapstructure:"redis_pwd" json:"redis_pwd"`
	REDIS_DB_NUM int    `mapstructure:"redis_db_num" json:"redis_db_num"`

	DBSTORE_TYPE     string `mapstructure:"dbstore_type" json:"dbstore_type"`
	DB_DSN           string `mapstructure:"db_dsn" json:"db_dsn"`
	DB_FILE          string `mapstructure:"db_file" json:"db_file"`
	APPLY_MIGRATIONS bool   `mapstructure:"apply_migrations" json:"apply_migrations"`
	DB_DEBUG_LOG     bool   `mapstructure:"db_debug_log" json:"db_debug_log"`

	USE_TLS       bool   `mapstructure:"use_tls" json:"use_tls"`
	CERT_FILE     string `mapstructure:"cert_file" json:"cert_file"`
	CERT_KEY_FILE string `mapstructure:"cert_key_file" json:"cert_key_file"`

	DEFAULT_RECORDS_AMOUNT_TO_GET int `mapstructure:"default_records_amount_to_get" json:"default_records_amount_to_get"`
	HASH_LENGTH                   int `mapstructure:"hash_length" json:"hash_length"`
}

type KeyAlreadyExists

type KeyAlreadyExists struct{}

func (*KeyAlreadyExists) Error

func (k *KeyAlreadyExists) Error() string

type NewLinkEvent

type NewLinkEvent struct {
	gorm.Model
	Key    string
	Value  string
	UserIP string
}

type RecordResponse

type RecordResponse struct {
	Shorturl  string
	Longurl   string
	CreatedAt string
}

type RecordsResponse

type RecordsResponse struct {
	IP      string
	Records []*RecordResponse
	Count   int
}

type RequestBody

type RequestBody struct {
	Url   string
	Alias string
}

type ResponseBody

type ResponseBody struct {
	Link        string
	OriginalUrl string
}

Jump to

Keyboard shortcuts

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