model

package
v0.0.0-...-1bce007 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Link struct {
	ID string `json:"-" swaggerignore:"true"`
	// Link short name as user requires, if empty will be generated, must be unique
	ShortName string `json:"shortName" example:"link-short-name" validate:"shortname"`
	// Original URL where to redirect the visitor
	OriginalURL string `json:"originalUrl" example:"https://example.com/my-cool-url-path" validate:"required,url,urlscheme"`
	// User comment
	Comment string `json:"comment" example:"Free text comment"`
}

Link defines a link structure that is used for redirects

func (*Link) FillDefaults

func (c *Link) FillDefaults()

FillDefaults sets defaults values for those that fields are not set Currently sets only Link.ShortName (builds a pseudo-random string up to 8 chars len)

func (Link) GetID

func (c Link) GetID() string

GetID to satisfy jsonapi.MarshalIdentifier interface

func (*Link) SetID

func (c *Link) SetID(id string) error

SetID to satisfy jsonapi.UnmarshalIdentifier interface

Jump to

Keyboard shortcuts

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