api

package
v0.0.0-...-5560467 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCtrl

func NewCtrl(log *logrus.Entry, svc Service) *ctrl

NewCtrl will create an object that represent the ctrl struct

func Ping

func Ping(w http.ResponseWriter, r *http.Request)

Ping will handle the ping endpoint

Types

type Repository

type Repository interface {
	Set(key, val string) error
	Get(key string) (string, error)
	GetMulti(keys []string) (map[string]*memcache.Item, error)
	Delete(key string) error
}

Repository represent the repositories

func NewMemcachedRepository

func NewMemcachedRepository(Client *memcache.Client) Repository

NewMemcachedRepository will create an object that represent the Repository interface

type Service

type Service interface {
	Set(key, value string) (int, error)
	Get(key string) (string, int, error)
	GetMulti(keys []string) (map[string]string, int, error)
	Delete(key string) (int, error)
}

Service represent the services

func NewService

func NewService(log *logrus.Entry, r Repository) Service

NewService will create an object that represent the Service interface

Directories

Path Synopsis
api_struct

Jump to

Keyboard shortcuts

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