Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrLinkNotExist . ErrLinkNotExist = errors.New("sorry, the link you accessed doesn't exist on our service. Please keep in mind that our shortened links are case sensitive and may contain letters and numbers") )
Functions ¶
func Get ¶
func Get(ctx context.Context, key string, redisClient *redis.Client, bf *bloomfilter.BloomFilter) (longurl string, err error)
Get url by key.
func Insert ¶
func Insert(ctx context.Context, rawurl, domain string, redisClient *redis.Client, bf *bloomfilter.BloomFilter) (string, error)
Insert url.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server can be installed to serve.
type ServerConfig ¶
type ServerConfig struct { RedisClient *redis.Client BloomFilter *bloomfilter.BloomFilter StaticPath string }
ServerConfig contains everything needed by a server.
Click to show internal directories.
Click to hide internal directories.