api

package
v0.0.0-...-3300c9c Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: MIT Imports: 11 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(c *gin.Context)

Ping will handle the ping endpoint

Types

type Repository

type Repository interface {
	Create(destination *form.DestinationForm) (interface{}, error)
	Find(search string) (interface{}, error)
	FindByID(id string) (interface{}, error)
	FindIndex() (bool, error)
	Delete(id string) error
}

Repository represent the repositories

func NewElasticsearchRepository

func NewElasticsearchRepository(Client *elastic.Client) Repository

NewElasticsearchRepository will create an object that represent the Repository interface

type Service

type Service interface {
	Create(user *form.DestinationForm) (interface{}, int, error)
	Find(search string) (interface{}, int, error)
	FindByID(id string) (interface{}, int, error)
	FindIndex() (bool, int, error)
	Delete(id 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