http

package
v0.0.0-...-6343e97 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	PingContext(ctx context.Context) error
}

DB represents a type that can be used to interact with the database.

type Server

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

Server represents a HTTP server that can handle requests for this microservice.

func New

func New(u Users, db DB) *Server

New will instantiate a new instance of Server.

func (*Server) AddRoutes

func (s *Server) AddRoutes(r *mux.Router) error

AddRoutes will add the routes this server supports to the router.

type Users

type Users interface {
	CreateUser(ctx context.Context, user *model.User) (*model.User, error)
	GetUser(ctx context.Context, id string) (*model.User, error)
	FindUsers(ctx context.Context, filters []model.Filter, offset, limit int64) ([]*model.User, error)
	UpdateUser(ctx context.Context, user *model.User) (*model.User, error)
	DeleteUser(ctx context.Context, id string) error
}

Users represents a type that can provide CRUD operations on users.

Directories

Path Synopsis
http
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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