services

package
v0.0.0-...-29bb57a Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package services is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	// Param returns path parameter by name.
	Param(name string) string

	// QueryParam returns the query param for the provided name.
	QueryParam(name string) string

	// IntQueryParam returns the query param for the provided name, converted to int
	IntQueryParam(name string) (uint64, error)

	// OptionalIntQueryParam returns the query param for the provided name, converted to int with a fallback
	OptionalIntQueryParam(name string, defaultValue uint64) (result uint64)

	// Get retrieves data from the context.
	Get(key string) interface{}

	// Set saves data in the context.
	Set(key string, val interface{})

	// Bind binds the request body into provided type `i`. The default binder
	// does it based on Content-Type header.
	Bind(i interface{}) error

	// String sends a string response with status code.
	String(code int, s string) error

	// NoContent sends a response with no body and a status code.
	NoContent(code int) error

	// JSON sends a JSON response with status code.
	JSON(code int, i interface{}) error

	// GetID gets the current id in the route
	GetID() (uint64, error)

	// Parses out the id in the route and binds it to the given variable
	BindID(*uint64) error

	// Returns the environment the app is running in
	Environment() domain.Environment

	// RealIP returns the client's network address based on `X-Forwarded-For`
	// or `X-Real-IP` request header.
	RealIP() string

	// UserAgent returns the client's user agent
	UserAgent() string
}

Context is a subset of the echo framework context, so we are not directly depending on it

type HandlerFunc

type HandlerFunc func(Context) error

HandlerFunc defines a function to serve HTTP requests.

type HealthService

type HealthService interface {
	// Ping is only used to see if the service is online, it doesn't do any health checks
	Ping(ctx Context) error
}

HealthService is responsible for metrics about the health of the service

func NewHealthService

func NewHealthService() HealthService

NewHealthService initializer

type MockContext

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

MockContext is a mock of Context interface

func NewMockContext

func NewMockContext(ctrl *gomock.Controller) *MockContext

NewMockContext creates a new mock instance

func (*MockContext) Bind

func (m *MockContext) Bind(i interface{}) error

Bind mocks base method

func (*MockContext) BindID

func (m *MockContext) BindID(arg0 *uint64) error

BindID mocks base method

func (*MockContext) EXPECT

func (m *MockContext) EXPECT() *MockContextMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockContext) Environment

func (m *MockContext) Environment() domain.Environment

Environment mocks base method

func (*MockContext) Get

func (m *MockContext) Get(key string) interface{}

Get mocks base method

func (*MockContext) GetID

func (m *MockContext) GetID() (uint64, error)

GetID mocks base method

func (*MockContext) IntQueryParam

func (m *MockContext) IntQueryParam(name string) (uint64, error)

IntQueryParam mocks base method

func (*MockContext) JSON

func (m *MockContext) JSON(code int, i interface{}) error

JSON mocks base method

func (*MockContext) NoContent

func (m *MockContext) NoContent(code int) error

NoContent mocks base method

func (*MockContext) OptionalIntQueryParam

func (m *MockContext) OptionalIntQueryParam(name string, defaultValue uint64) uint64

OptionalIntQueryParam mocks base method

func (*MockContext) Param

func (m *MockContext) Param(name string) string

Param mocks base method

func (*MockContext) QueryParam

func (m *MockContext) QueryParam(name string) string

QueryParam mocks base method

func (*MockContext) RealIP

func (m *MockContext) RealIP() string

RealIP mocks base method

func (*MockContext) Set

func (m *MockContext) Set(key string, val interface{})

Set mocks base method

func (*MockContext) String

func (m *MockContext) String(code int, s string) error

String mocks base method

func (*MockContext) UserAgent

func (m *MockContext) UserAgent() string

UserAgent mocks base method

type MockContextMockRecorder

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

MockContextMockRecorder is the mock recorder for MockContext

func (*MockContextMockRecorder) Bind

func (mr *MockContextMockRecorder) Bind(i interface{}) *gomock.Call

Bind indicates an expected call of Bind

func (*MockContextMockRecorder) BindID

func (mr *MockContextMockRecorder) BindID(arg0 interface{}) *gomock.Call

BindID indicates an expected call of BindID

func (*MockContextMockRecorder) Environment

func (mr *MockContextMockRecorder) Environment() *gomock.Call

Environment indicates an expected call of Environment

func (*MockContextMockRecorder) Get

func (mr *MockContextMockRecorder) Get(key interface{}) *gomock.Call

Get indicates an expected call of Get

func (*MockContextMockRecorder) GetID

func (mr *MockContextMockRecorder) GetID() *gomock.Call

GetID indicates an expected call of GetID

func (*MockContextMockRecorder) IntQueryParam

func (mr *MockContextMockRecorder) IntQueryParam(name interface{}) *gomock.Call

IntQueryParam indicates an expected call of IntQueryParam

func (*MockContextMockRecorder) JSON

func (mr *MockContextMockRecorder) JSON(code, i interface{}) *gomock.Call

JSON indicates an expected call of JSON

func (*MockContextMockRecorder) NoContent

func (mr *MockContextMockRecorder) NoContent(code interface{}) *gomock.Call

NoContent indicates an expected call of NoContent

func (*MockContextMockRecorder) OptionalIntQueryParam

func (mr *MockContextMockRecorder) OptionalIntQueryParam(name, defaultValue interface{}) *gomock.Call

OptionalIntQueryParam indicates an expected call of OptionalIntQueryParam

func (*MockContextMockRecorder) Param

func (mr *MockContextMockRecorder) Param(name interface{}) *gomock.Call

Param indicates an expected call of Param

func (*MockContextMockRecorder) QueryParam

func (mr *MockContextMockRecorder) QueryParam(name interface{}) *gomock.Call

QueryParam indicates an expected call of QueryParam

func (*MockContextMockRecorder) RealIP

func (mr *MockContextMockRecorder) RealIP() *gomock.Call

RealIP indicates an expected call of RealIP

func (*MockContextMockRecorder) Set

func (mr *MockContextMockRecorder) Set(key, val interface{}) *gomock.Call

Set indicates an expected call of Set

func (*MockContextMockRecorder) String

func (mr *MockContextMockRecorder) String(code, s interface{}) *gomock.Call

String indicates an expected call of String

func (*MockContextMockRecorder) UserAgent

func (mr *MockContextMockRecorder) UserAgent() *gomock.Call

UserAgent indicates an expected call of UserAgent

type ResumeService

type ResumeService interface {
	Get(ctx Context) error
}

ResumeService is responsible for handling HTTP requests

func NewResumeService

func NewResumeService(resumeInteractor usecases.ResumeInteractor) ResumeService

NewResumeService initializer

type Route

type Route struct {
	Method      string
	Path        string
	HandlerFunc HandlerFunc
}

Route is a definition of a route

type Router

type Router interface {
	StartListening() error
	ServeHTTP(w http.ResponseWriter, r *http.Request)
}

Router takes care of all the routing

Jump to

Keyboard shortcuts

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