database

package
v0.0.0-...-3cf6f44 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CollShortUrls = "short_urls"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewMongoClient

func NewMongoClient(appConfig *config.AppConfig) (*Client, error)

func (*Client) DeleteById

func (c *Client) DeleteById(ctx context.Context, id string) error

func (*Client) FindById

func (c *Client) FindById(ctx context.Context, id string) (*shortener.ModelShorten, error)

func (*Client) FindUrl

func (c *Client) FindUrl(ctx context.Context, url string) (*shortener.ModelShorten, error)

TODO: ensure index on url

func (*Client) IncrementCount

func (c *Client) IncrementCount(ctx context.Context, id string) (*shortener.ModelShorten, error)

func (*Client) StoreUrl

func (c *Client) StoreUrl(ctx context.Context, document interface{}) error

Jump to

Keyboard shortcuts

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