Documentation ¶
Index ¶
- Variables
- type InMemoryLinksBackend
- func (s InMemoryLinksBackend) CreateOrUpdateLink(entry *generated.Link) error
- func (s InMemoryLinksBackend) DeleteLink(shortUrl string) error
- func (s InMemoryLinksBackend) GetAllLinksPaginated(offset int, pagesize int) (*[]generated.Link, error)
- func (s InMemoryLinksBackend) GetLinkMetadata(shortUrl string) (link *generated.Link, err error)
- func (s InMemoryLinksBackend) GetOwnersLinks(owner string) (links *[]generated.Link, err error)
- func (InMemoryLinksBackend) GetOwnersLinksPaginated(owner string, offset int, pagesize int) (links *[]generated.Link, err error)
- func (s InMemoryLinksBackend) GetTargetLink(url string) (target *string, permanent bool, err error)
- func (s InMemoryLinksBackend) Start()
- type LinksBackend
- type PostgresConfig
- type PostgresLinksBackend
- func (s PostgresLinksBackend) CreateOrUpdateLink(entry *generated.Link) error
- func (s PostgresLinksBackend) DeleteLink(url string) error
- func (s PostgresLinksBackend) GetAllLinksPaginated(offset int, pagesize int) (links *[]generated.Link, err error)
- func (s PostgresLinksBackend) GetLinkMetadata(url string) (link *generated.Link, err error)
- func (s PostgresLinksBackend) GetOwnersLinks(owner string) (links *[]generated.Link, err error)
- func (s PostgresLinksBackend) GetOwnersLinksPaginated(owner string, offset int, pagesize int) (links *[]generated.Link, err error)
- func (s PostgresLinksBackend) GetTargetLink(url string) (target *string, permanent bool, err error)
- func (s PostgresLinksBackend) Start()
- type RedisConfig
- type RedisLinksBackend
- func (r *RedisLinksBackend) CreateOrUpdateLink(link *generated.Link) error
- func (r *RedisLinksBackend) DeleteLink(url string) error
- func (r *RedisLinksBackend) GetAllLinksPaginated(offset int, pagesize int) (links *[]generated.Link, err error)
- func (r *RedisLinksBackend) GetLinkMetadata(url string) (link *generated.Link, err error)
- func (r *RedisLinksBackend) GetOwnersLinks(owner string) (links *[]generated.Link, err error)
- func (r *RedisLinksBackend) GetOwnersLinksPaginated(owner string, offset int, pagesize int) (links *[]generated.Link, err error)
- func (r *RedisLinksBackend) GetTargetLink(url string) (target *string, permanent bool, err error)
- func (r *RedisLinksBackend) Start()
Constants ¶
This section is empty.
Variables ¶
var DEFAULT_DATABASE = 0
Functions ¶
This section is empty.
Types ¶
type InMemoryLinksBackend ¶
func (InMemoryLinksBackend) CreateOrUpdateLink ¶
func (s InMemoryLinksBackend) CreateOrUpdateLink(entry *generated.Link) error
func (InMemoryLinksBackend) DeleteLink ¶
func (s InMemoryLinksBackend) DeleteLink(shortUrl string) error
func (InMemoryLinksBackend) GetAllLinksPaginated ¶
func (s InMemoryLinksBackend) GetAllLinksPaginated(offset int, pagesize int) (*[]generated.Link, error)
getAllLinksPaginated implements LinksBackend.
func (InMemoryLinksBackend) GetLinkMetadata ¶
func (s InMemoryLinksBackend) GetLinkMetadata(shortUrl string) (link *generated.Link, err error)
func (InMemoryLinksBackend) GetOwnersLinks ¶
func (s InMemoryLinksBackend) GetOwnersLinks(owner string) (links *[]generated.Link, err error)
func (InMemoryLinksBackend) GetOwnersLinksPaginated ¶
func (InMemoryLinksBackend) GetOwnersLinksPaginated(owner string, offset int, pagesize int) (links *[]generated.Link, err error)
getOwnersLinksPaginated implements LinksBackend.
func (InMemoryLinksBackend) GetTargetLink ¶
func (s InMemoryLinksBackend) GetTargetLink(url string) (target *string, permanent bool, err error)
func (InMemoryLinksBackend) Start ¶
func (s InMemoryLinksBackend) Start()
type LinksBackend ¶
type LinksBackend interface { Start() CreateOrUpdateLink(*generated.Link) error GetTargetLink(url string) (*string, bool, error) GetOwnersLinks(owner string) (*[]generated.Link, error) GetOwnersLinksPaginated(owner string, offset int, pagesize int) (*[]generated.Link, error) GetAllLinksPaginated(offset int, pagesize int) (*[]generated.Link, error) GetLinkMetadata(url string) (*generated.Link, error) DeleteLink(url string) error }
func BuildRedisBackend ¶
func BuildRedisBackend(config RedisConfig) LinksBackend
type PostgresConfig ¶
type PostgresLinksBackend ¶
func BuildPostgresBackend ¶
func BuildPostgresBackend(localConfig PostgresConfig) PostgresLinksBackend
func (PostgresLinksBackend) CreateOrUpdateLink ¶
func (s PostgresLinksBackend) CreateOrUpdateLink(entry *generated.Link) error
CreateOrUpdateLink implements LinksBackend.
func (PostgresLinksBackend) DeleteLink ¶
func (s PostgresLinksBackend) DeleteLink(url string) error
DeleteLink implements LinksBackend.
func (PostgresLinksBackend) GetAllLinksPaginated ¶
func (s PostgresLinksBackend) GetAllLinksPaginated(offset int, pagesize int) (links *[]generated.Link, err error)
GetAllLinksPaginated implements LinksBackend.
func (PostgresLinksBackend) GetLinkMetadata ¶
func (s PostgresLinksBackend) GetLinkMetadata(url string) (link *generated.Link, err error)
GetLinkMetadata implements LinksBackend.
func (PostgresLinksBackend) GetOwnersLinks ¶
func (s PostgresLinksBackend) GetOwnersLinks(owner string) (links *[]generated.Link, err error)
GetOwnersLinks implements LinksBackend.
func (PostgresLinksBackend) GetOwnersLinksPaginated ¶
func (s PostgresLinksBackend) GetOwnersLinksPaginated(owner string, offset int, pagesize int) (links *[]generated.Link, err error)
GetOwnersLinksPaginated implements LinksBackend.
func (PostgresLinksBackend) GetTargetLink ¶
func (s PostgresLinksBackend) GetTargetLink(url string) (target *string, permanent bool, err error)
GetTargetLink implements LinksBackend.
func (PostgresLinksBackend) Start ¶
func (s PostgresLinksBackend) Start()
type RedisConfig ¶
type RedisLinksBackend ¶
type RedisLinksBackend struct {
// contains filtered or unexported fields
}
func (*RedisLinksBackend) CreateOrUpdateLink ¶
func (r *RedisLinksBackend) CreateOrUpdateLink(link *generated.Link) error
CreateOrUpdateLink implements LinksBackend.
func (*RedisLinksBackend) DeleteLink ¶
func (r *RedisLinksBackend) DeleteLink(url string) error
DeleteLink implements LinksBackend.
func (*RedisLinksBackend) GetAllLinksPaginated ¶
func (r *RedisLinksBackend) GetAllLinksPaginated(offset int, pagesize int) (links *[]generated.Link, err error)
GetAllLinksPaginated implements LinksBackend.
func (*RedisLinksBackend) GetLinkMetadata ¶
func (r *RedisLinksBackend) GetLinkMetadata(url string) (link *generated.Link, err error)
GetLinkMetadata implements LinksBackend.
func (*RedisLinksBackend) GetOwnersLinks ¶
func (r *RedisLinksBackend) GetOwnersLinks(owner string) (links *[]generated.Link, err error)
GetOwnersLinks implements LinksBackend.
func (*RedisLinksBackend) GetOwnersLinksPaginated ¶
func (r *RedisLinksBackend) GetOwnersLinksPaginated(owner string, offset int, pagesize int) (links *[]generated.Link, err error)
GetOwnersLinksPaginated implements LinksBackend.
func (*RedisLinksBackend) GetTargetLink ¶
func (r *RedisLinksBackend) GetTargetLink(url string) (target *string, permanent bool, err error)
GetTargetLink implements LinksBackend.
func (*RedisLinksBackend) Start ¶
func (r *RedisLinksBackend) Start()
Start implements LinksBackend.