types

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2019 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound     = errors.New("not found\n")
	ErrAlreadyExist = errors.New("custom URL already exist\n")
	ErrURLExpired   = errors.New("url expired\n")
	ErrWronPass     = errors.New("wrong password\n")
	ErrURLTooLong   = errors.New("URL too long\n")
	ErrSameHost     = errors.New("can not shorten URL has the same host\n")
	ErrScheme       = errors.New("unsupported scheme\n")
	ErrRateExceded  = errors.New("rate exceeded\n")
)

Functions

This section is empty.

Types

type ShortOptions added in v0.1.5

type ShortOptions struct {
	Passwd string
	Custom string
	TTL    time.Duration
}

type URL

type URL struct {
	Ori    string
	Passwd string
	Short  string
	Hash   string
	Expire *time.Time
	// contains filtered or unexported fields
}

func (*URL) Bytes added in v0.1.5

func (u *URL) Bytes() []byte

func (*URL) Decode added in v0.1.5

func (u *URL) Decode(byts []byte) *URL

func (*URL) Expired added in v0.1.5

func (u *URL) Expired() bool

func (*URL) HashSum added in v0.1.5

func (u *URL) HashSum() []byte

func (*URL) ShortURL added in v0.1.5

func (u *URL) ShortURL() []byte

Jump to

Keyboard shortcuts

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