lit

package module
v0.0.0-...-c5966c3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

README

Lightning

Description

Project Status

Name Status
Pipeline CircleCI
Coverage Coverage
Release Version GitHub release
Tag Version GitHub tag (latest by date)

Getting started

To make it easy for you to get started with GitLab, here's a list of recommended next steps.

Already a pro? Just edit this README.md and make it your own. Want to make it easy? Use the template at the bottom!

Add your files

cd existing_repo
git remote add origin https://gitlab.com/bizgroup2/lightning.git
git branch -M main
git push -uf origin main

Integrate with your tools

Collaborate with your team

Test and Deploy

Use the built-in continuous integration in GitLab.


Editing this README

When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to makeareadme.com for this template.

Suggestions for a good README

Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.

Name

Choose a self-explaining name for your project.

Description

Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.

Badges

On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.

Visuals

Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.

Installation

Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.

Usage

Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.

Support

Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.

Roadmap

If you have ideas for releases in the future, it is a good idea to list them in the README.

Contributing

State if you are open to contributions and what your requirements are for accepting them.

For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.

You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.

Authors and acknowledgment

Show your appreciation to those who have contributed to the project.

License

For open source projects, say how it is licensed.

Project status

If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HTTP errors
	ErrInternalServerError = HttpError{Status: http.StatusInternalServerError, Code: "internal_server_error", Description: "internal server error"}

	// gRPC errors
	ErrGRPCInternalServerError = status.Errorf(codes.Internal, "internal server error")
)

Functions

func NewRouterForTest

func NewRouterForTest(w http.ResponseWriter) (Router, Context, func())

Types

type Context

type Context interface {
	context.Context

	Request() *http.Request

	Writer() ResponseWriter

	SetRequest(*http.Request)

	SetRequestContext(ctx context.Context) *http.Request

	SetWriter(w ResponseWriter)

	Bind(obj interface{}) error

	FormFile(name string) (*multipart.FileHeader, error)

	MultipartForm() (*multipart.Form, error)

	Set(key string, value any)

	Get(key string) (value any, exists bool)

	Status(code int)

	Header(key string, value string)

	JSON(code int, obj any)

	JSONP(code int, obj any)

	ProtoBuf(code int, obj any)

	AbortWithStatus(code int)

	AbortWithError(err error)

	Next()
}

type ErrHandlerFunc

type ErrHandlerFunc func(ctx Context) error

ErrHandlerFunc represents a lightning handler error function

type ExpectedError

type ExpectedError interface {
	error

	StatusCode() int

	ErrorCode() string
}

ExpectedError represents a known error that should be returned to the client. It helps the framework distinguish expected errors from unexpected ones for monitoring purposes.

type GRPCOption

type GRPCOption func(option *[]grpc.ServerOption)

func WithDefaultInterceptors

func WithDefaultInterceptors(ctx context.Context) GRPCOption

func WithTLSConfig

func WithTLSConfig(tlsConfig *tls.Config) GRPCOption

type GRPCServer

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

func NewGRPCServer

func NewGRPCServer(ctx context.Context, addr string) (GRPCServer, error)

func NewGRPCServerWithOptions

func NewGRPCServerWithOptions(ctx context.Context, addr string, opts ...GRPCOption) (GRPCServer, error)

func (GRPCServer) Registrar

func (srv GRPCServer) Registrar() ServiceRegistrar

func (GRPCServer) Run

func (srv GRPCServer) Run() error

type HandlerFunc

type HandlerFunc func(ctx Context)

HandlerFunc represents a lightning handler function

type HttpError

type HttpError struct {
	Status      int    `json:"-"`
	Code        string `json:"error"`
	Description string `json:"error_description"`
}

HttpError represents an expected error from HTTP request

func (HttpError) Error

func (e HttpError) Error() string

func (HttpError) ErrorCode

func (e HttpError) ErrorCode() string

func (HttpError) StatusCode

func (e HttpError) StatusCode() int

type MockContext

type MockContext struct {
	mock.Mock
}

MockContext is an autogenerated mock type for the Context type

func NewMockContext

func NewMockContext(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockContext

NewMockContext creates a new instance of MockContext. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockContext) AbortWithError

func (_m *MockContext) AbortWithError(err error)

AbortWithError provides a mock function with given fields: err

func (*MockContext) AbortWithStatus

func (_m *MockContext) AbortWithStatus(code int)

AbortWithStatus provides a mock function with given fields: code

func (*MockContext) Bind

func (_m *MockContext) Bind(obj interface{}) error

Bind provides a mock function with given fields: obj

func (*MockContext) Deadline

func (_m *MockContext) Deadline() (time.Time, bool)

Deadline provides a mock function with no fields

func (*MockContext) Done

func (_m *MockContext) Done() <-chan struct{}

Done provides a mock function with no fields

func (*MockContext) EXPECT

func (_m *MockContext) EXPECT() *MockContext_Expecter

func (*MockContext) Err

func (_m *MockContext) Err() error

Err provides a mock function with no fields

func (*MockContext) FormFile

func (_m *MockContext) FormFile(name string) (*multipart.FileHeader, error)

FormFile provides a mock function with given fields: name

func (*MockContext) Get

func (_m *MockContext) Get(key string) (any, bool)

Get provides a mock function with given fields: key

func (*MockContext) Header

func (_m *MockContext) Header(key string, value string)

Header provides a mock function with given fields: key, value

func (*MockContext) JSON

func (_m *MockContext) JSON(code int, obj any)

JSON provides a mock function with given fields: code, obj

func (*MockContext) JSONP

func (_m *MockContext) JSONP(code int, obj any)

JSONP provides a mock function with given fields: code, obj

func (*MockContext) MultipartForm

func (_m *MockContext) MultipartForm() (*multipart.Form, error)

MultipartForm provides a mock function with no fields

func (*MockContext) Next

func (_m *MockContext) Next()

Next provides a mock function with no fields

func (*MockContext) ProtoBuf

func (_m *MockContext) ProtoBuf(code int, obj any)

ProtoBuf provides a mock function with given fields: code, obj

func (*MockContext) Request

func (_m *MockContext) Request() *http.Request

Request provides a mock function with no fields

func (*MockContext) Set

func (_m *MockContext) Set(key string, value any)

Set provides a mock function with given fields: key, value

func (*MockContext) SetRequest

func (_m *MockContext) SetRequest(_a0 *http.Request)

SetRequest provides a mock function with given fields: _a0

func (*MockContext) SetRequestContext

func (_m *MockContext) SetRequestContext(ctx context.Context) *http.Request

SetRequestContext provides a mock function with given fields: ctx

func (*MockContext) SetWriter

func (_m *MockContext) SetWriter(w ResponseWriter)

SetWriter provides a mock function with given fields: w

func (*MockContext) Status

func (_m *MockContext) Status(code int)

Status provides a mock function with given fields: code

func (*MockContext) Value

func (_m *MockContext) Value(key any) any

Value provides a mock function with given fields: key

func (*MockContext) Writer

func (_m *MockContext) Writer() ResponseWriter

Writer provides a mock function with no fields

type MockContext_AbortWithError_Call

type MockContext_AbortWithError_Call struct {
	*mock.Call
}

MockContext_AbortWithError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbortWithError'

func (*MockContext_AbortWithError_Call) Return

func (*MockContext_AbortWithError_Call) Run

func (*MockContext_AbortWithError_Call) RunAndReturn

type MockContext_AbortWithStatus_Call

type MockContext_AbortWithStatus_Call struct {
	*mock.Call
}

MockContext_AbortWithStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbortWithStatus'

func (*MockContext_AbortWithStatus_Call) Return

func (*MockContext_AbortWithStatus_Call) Run

func (*MockContext_AbortWithStatus_Call) RunAndReturn

type MockContext_Bind_Call

type MockContext_Bind_Call struct {
	*mock.Call
}

MockContext_Bind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bind'

func (*MockContext_Bind_Call) Return

func (*MockContext_Bind_Call) Run

func (_c *MockContext_Bind_Call) Run(run func(obj interface{})) *MockContext_Bind_Call

func (*MockContext_Bind_Call) RunAndReturn

func (_c *MockContext_Bind_Call) RunAndReturn(run func(interface{}) error) *MockContext_Bind_Call

type MockContext_Deadline_Call

type MockContext_Deadline_Call struct {
	*mock.Call
}

MockContext_Deadline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deadline'

func (*MockContext_Deadline_Call) Return

func (*MockContext_Deadline_Call) Run

func (*MockContext_Deadline_Call) RunAndReturn

func (_c *MockContext_Deadline_Call) RunAndReturn(run func() (time.Time, bool)) *MockContext_Deadline_Call

type MockContext_Done_Call

type MockContext_Done_Call struct {
	*mock.Call
}

MockContext_Done_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Done'

func (*MockContext_Done_Call) Return

func (_c *MockContext_Done_Call) Return(_a0 <-chan struct{}) *MockContext_Done_Call

func (*MockContext_Done_Call) Run

func (_c *MockContext_Done_Call) Run(run func()) *MockContext_Done_Call

func (*MockContext_Done_Call) RunAndReturn

func (_c *MockContext_Done_Call) RunAndReturn(run func() <-chan struct{}) *MockContext_Done_Call

type MockContext_Err_Call

type MockContext_Err_Call struct {
	*mock.Call
}

MockContext_Err_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Err'

func (*MockContext_Err_Call) Return

func (*MockContext_Err_Call) Run

func (_c *MockContext_Err_Call) Run(run func()) *MockContext_Err_Call

func (*MockContext_Err_Call) RunAndReturn

func (_c *MockContext_Err_Call) RunAndReturn(run func() error) *MockContext_Err_Call

type MockContext_Expecter

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

func (*MockContext_Expecter) AbortWithError

func (_e *MockContext_Expecter) AbortWithError(err interface{}) *MockContext_AbortWithError_Call

AbortWithError is a helper method to define mock.On call

  • err error

func (*MockContext_Expecter) AbortWithStatus

func (_e *MockContext_Expecter) AbortWithStatus(code interface{}) *MockContext_AbortWithStatus_Call

AbortWithStatus is a helper method to define mock.On call

  • code int

func (*MockContext_Expecter) Bind

func (_e *MockContext_Expecter) Bind(obj interface{}) *MockContext_Bind_Call

Bind is a helper method to define mock.On call

  • obj interface{}

func (*MockContext_Expecter) Deadline

Deadline is a helper method to define mock.On call

func (*MockContext_Expecter) Done

Done is a helper method to define mock.On call

func (*MockContext_Expecter) Err

Err is a helper method to define mock.On call

func (*MockContext_Expecter) FormFile

func (_e *MockContext_Expecter) FormFile(name interface{}) *MockContext_FormFile_Call

FormFile is a helper method to define mock.On call

  • name string

func (*MockContext_Expecter) Get

func (_e *MockContext_Expecter) Get(key interface{}) *MockContext_Get_Call

Get is a helper method to define mock.On call

  • key string

func (*MockContext_Expecter) Header

func (_e *MockContext_Expecter) Header(key interface{}, value interface{}) *MockContext_Header_Call

Header is a helper method to define mock.On call

  • key string
  • value string

func (*MockContext_Expecter) JSON

func (_e *MockContext_Expecter) JSON(code interface{}, obj interface{}) *MockContext_JSON_Call

JSON is a helper method to define mock.On call

  • code int
  • obj any

func (*MockContext_Expecter) JSONP

func (_e *MockContext_Expecter) JSONP(code interface{}, obj interface{}) *MockContext_JSONP_Call

JSONP is a helper method to define mock.On call

  • code int
  • obj any

func (*MockContext_Expecter) MultipartForm

MultipartForm is a helper method to define mock.On call

func (*MockContext_Expecter) Next

Next is a helper method to define mock.On call

func (*MockContext_Expecter) ProtoBuf

func (_e *MockContext_Expecter) ProtoBuf(code interface{}, obj interface{}) *MockContext_ProtoBuf_Call

ProtoBuf is a helper method to define mock.On call

  • code int
  • obj any

func (*MockContext_Expecter) Request

Request is a helper method to define mock.On call

func (*MockContext_Expecter) Set

func (_e *MockContext_Expecter) Set(key interface{}, value interface{}) *MockContext_Set_Call

Set is a helper method to define mock.On call

  • key string
  • value any

func (*MockContext_Expecter) SetRequest

func (_e *MockContext_Expecter) SetRequest(_a0 interface{}) *MockContext_SetRequest_Call

SetRequest is a helper method to define mock.On call

  • _a0 *http.Request

func (*MockContext_Expecter) SetRequestContext

func (_e *MockContext_Expecter) SetRequestContext(ctx interface{}) *MockContext_SetRequestContext_Call

SetRequestContext is a helper method to define mock.On call

  • ctx context.Context

func (*MockContext_Expecter) SetWriter

func (_e *MockContext_Expecter) SetWriter(w interface{}) *MockContext_SetWriter_Call

SetWriter is a helper method to define mock.On call

  • w ResponseWriter

func (*MockContext_Expecter) Status

func (_e *MockContext_Expecter) Status(code interface{}) *MockContext_Status_Call

Status is a helper method to define mock.On call

  • code int

func (*MockContext_Expecter) Value

func (_e *MockContext_Expecter) Value(key interface{}) *MockContext_Value_Call

Value is a helper method to define mock.On call

  • key any

func (*MockContext_Expecter) Writer

Writer is a helper method to define mock.On call

type MockContext_FormFile_Call

type MockContext_FormFile_Call struct {
	*mock.Call
}

MockContext_FormFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FormFile'

func (*MockContext_FormFile_Call) Return

func (*MockContext_FormFile_Call) Run

func (*MockContext_FormFile_Call) RunAndReturn

type MockContext_Get_Call

type MockContext_Get_Call struct {
	*mock.Call
}

MockContext_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'

func (*MockContext_Get_Call) Return

func (_c *MockContext_Get_Call) Return(value any, exists bool) *MockContext_Get_Call

func (*MockContext_Get_Call) Run

func (_c *MockContext_Get_Call) Run(run func(key string)) *MockContext_Get_Call

func (*MockContext_Get_Call) RunAndReturn

func (_c *MockContext_Get_Call) RunAndReturn(run func(string) (any, bool)) *MockContext_Get_Call

type MockContext_Header_Call

type MockContext_Header_Call struct {
	*mock.Call
}

MockContext_Header_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Header'

func (*MockContext_Header_Call) Return

func (*MockContext_Header_Call) Run

func (_c *MockContext_Header_Call) Run(run func(key string, value string)) *MockContext_Header_Call

func (*MockContext_Header_Call) RunAndReturn

func (_c *MockContext_Header_Call) RunAndReturn(run func(string, string)) *MockContext_Header_Call

type MockContext_JSONP_Call

type MockContext_JSONP_Call struct {
	*mock.Call
}

MockContext_JSONP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'JSONP'

func (*MockContext_JSONP_Call) Return

func (*MockContext_JSONP_Call) Run

func (_c *MockContext_JSONP_Call) Run(run func(code int, obj any)) *MockContext_JSONP_Call

func (*MockContext_JSONP_Call) RunAndReturn

func (_c *MockContext_JSONP_Call) RunAndReturn(run func(int, any)) *MockContext_JSONP_Call

type MockContext_JSON_Call

type MockContext_JSON_Call struct {
	*mock.Call
}

MockContext_JSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'JSON'

func (*MockContext_JSON_Call) Return

func (*MockContext_JSON_Call) Run

func (_c *MockContext_JSON_Call) Run(run func(code int, obj any)) *MockContext_JSON_Call

func (*MockContext_JSON_Call) RunAndReturn

func (_c *MockContext_JSON_Call) RunAndReturn(run func(int, any)) *MockContext_JSON_Call

type MockContext_MultipartForm_Call

type MockContext_MultipartForm_Call struct {
	*mock.Call
}

MockContext_MultipartForm_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MultipartForm'

func (*MockContext_MultipartForm_Call) Return

func (*MockContext_MultipartForm_Call) Run

func (*MockContext_MultipartForm_Call) RunAndReturn

type MockContext_Next_Call

type MockContext_Next_Call struct {
	*mock.Call
}

MockContext_Next_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Next'

func (*MockContext_Next_Call) Return

func (*MockContext_Next_Call) Run

func (_c *MockContext_Next_Call) Run(run func()) *MockContext_Next_Call

func (*MockContext_Next_Call) RunAndReturn

func (_c *MockContext_Next_Call) RunAndReturn(run func()) *MockContext_Next_Call

type MockContext_ProtoBuf_Call

type MockContext_ProtoBuf_Call struct {
	*mock.Call
}

MockContext_ProtoBuf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProtoBuf'

func (*MockContext_ProtoBuf_Call) Return

func (*MockContext_ProtoBuf_Call) Run

func (_c *MockContext_ProtoBuf_Call) Run(run func(code int, obj any)) *MockContext_ProtoBuf_Call

func (*MockContext_ProtoBuf_Call) RunAndReturn

func (_c *MockContext_ProtoBuf_Call) RunAndReturn(run func(int, any)) *MockContext_ProtoBuf_Call

type MockContext_Request_Call

type MockContext_Request_Call struct {
	*mock.Call
}

MockContext_Request_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Request'

func (*MockContext_Request_Call) Return

func (*MockContext_Request_Call) Run

func (*MockContext_Request_Call) RunAndReturn

func (_c *MockContext_Request_Call) RunAndReturn(run func() *http.Request) *MockContext_Request_Call

type MockContext_SetRequestContext_Call

type MockContext_SetRequestContext_Call struct {
	*mock.Call
}

MockContext_SetRequestContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRequestContext'

func (*MockContext_SetRequestContext_Call) Return

func (*MockContext_SetRequestContext_Call) Run

func (*MockContext_SetRequestContext_Call) RunAndReturn

type MockContext_SetRequest_Call

type MockContext_SetRequest_Call struct {
	*mock.Call
}

MockContext_SetRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRequest'

func (*MockContext_SetRequest_Call) Return

func (*MockContext_SetRequest_Call) Run

func (*MockContext_SetRequest_Call) RunAndReturn

type MockContext_SetWriter_Call

type MockContext_SetWriter_Call struct {
	*mock.Call
}

MockContext_SetWriter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetWriter'

func (*MockContext_SetWriter_Call) Return

func (*MockContext_SetWriter_Call) Run

func (*MockContext_SetWriter_Call) RunAndReturn

type MockContext_Set_Call

type MockContext_Set_Call struct {
	*mock.Call
}

MockContext_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set'

func (*MockContext_Set_Call) Return

func (*MockContext_Set_Call) Run

func (_c *MockContext_Set_Call) Run(run func(key string, value any)) *MockContext_Set_Call

func (*MockContext_Set_Call) RunAndReturn

func (_c *MockContext_Set_Call) RunAndReturn(run func(string, any)) *MockContext_Set_Call

type MockContext_Status_Call

type MockContext_Status_Call struct {
	*mock.Call
}

MockContext_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status'

func (*MockContext_Status_Call) Return

func (*MockContext_Status_Call) Run

func (_c *MockContext_Status_Call) Run(run func(code int)) *MockContext_Status_Call

func (*MockContext_Status_Call) RunAndReturn

func (_c *MockContext_Status_Call) RunAndReturn(run func(int)) *MockContext_Status_Call

type MockContext_Value_Call

type MockContext_Value_Call struct {
	*mock.Call
}

MockContext_Value_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Value'

func (*MockContext_Value_Call) Return

func (*MockContext_Value_Call) Run

func (_c *MockContext_Value_Call) Run(run func(key any)) *MockContext_Value_Call

func (*MockContext_Value_Call) RunAndReturn

func (_c *MockContext_Value_Call) RunAndReturn(run func(any) any) *MockContext_Value_Call

type MockContext_Writer_Call

type MockContext_Writer_Call struct {
	*mock.Call
}

MockContext_Writer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Writer'

func (*MockContext_Writer_Call) Return

func (*MockContext_Writer_Call) Run

func (_c *MockContext_Writer_Call) Run(run func()) *MockContext_Writer_Call

func (*MockContext_Writer_Call) RunAndReturn

func (_c *MockContext_Writer_Call) RunAndReturn(run func() ResponseWriter) *MockContext_Writer_Call

type MockErrHandlerFunc

type MockErrHandlerFunc struct {
	mock.Mock
}

MockErrHandlerFunc is an autogenerated mock type for the ErrHandlerFunc type

func NewMockErrHandlerFunc

func NewMockErrHandlerFunc(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockErrHandlerFunc

NewMockErrHandlerFunc creates a new instance of MockErrHandlerFunc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockErrHandlerFunc) EXPECT

func (*MockErrHandlerFunc) Execute

func (_m *MockErrHandlerFunc) Execute(ctx Context) error

Execute provides a mock function with given fields: ctx

type MockErrHandlerFunc_Execute_Call

type MockErrHandlerFunc_Execute_Call struct {
	*mock.Call
}

MockErrHandlerFunc_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'

func (*MockErrHandlerFunc_Execute_Call) Return

func (*MockErrHandlerFunc_Execute_Call) Run

func (*MockErrHandlerFunc_Execute_Call) RunAndReturn

type MockErrHandlerFunc_Expecter

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

func (*MockErrHandlerFunc_Expecter) Execute

func (_e *MockErrHandlerFunc_Expecter) Execute(ctx interface{}) *MockErrHandlerFunc_Execute_Call

Execute is a helper method to define mock.On call

  • ctx Context

type MockGRPCOption

type MockGRPCOption struct {
	mock.Mock
}

MockGRPCOption is an autogenerated mock type for the GRPCOption type

func NewMockGRPCOption

func NewMockGRPCOption(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockGRPCOption

NewMockGRPCOption creates a new instance of MockGRPCOption. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockGRPCOption) EXPECT

func (*MockGRPCOption) Execute

func (_m *MockGRPCOption) Execute(option *[]grpc.ServerOption)

Execute provides a mock function with given fields: option

type MockGRPCOption_Execute_Call

type MockGRPCOption_Execute_Call struct {
	*mock.Call
}

MockGRPCOption_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'

func (*MockGRPCOption_Execute_Call) Return

func (*MockGRPCOption_Execute_Call) Run

func (*MockGRPCOption_Execute_Call) RunAndReturn

type MockGRPCOption_Expecter

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

func (*MockGRPCOption_Expecter) Execute

func (_e *MockGRPCOption_Expecter) Execute(option interface{}) *MockGRPCOption_Execute_Call

Execute is a helper method to define mock.On call

  • option *[]grpc.ServerOption

type MockHandlerFunc

type MockHandlerFunc struct {
	mock.Mock
}

MockHandlerFunc is an autogenerated mock type for the HandlerFunc type

func NewMockHandlerFunc

func NewMockHandlerFunc(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockHandlerFunc

NewMockHandlerFunc creates a new instance of MockHandlerFunc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockHandlerFunc) EXPECT

func (*MockHandlerFunc) Execute

func (_m *MockHandlerFunc) Execute(ctx Context)

Execute provides a mock function with given fields: ctx

type MockHandlerFunc_Execute_Call

type MockHandlerFunc_Execute_Call struct {
	*mock.Call
}

MockHandlerFunc_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'

func (*MockHandlerFunc_Execute_Call) Return

func (*MockHandlerFunc_Execute_Call) Run

func (*MockHandlerFunc_Execute_Call) RunAndReturn

type MockHandlerFunc_Expecter

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

func (*MockHandlerFunc_Expecter) Execute

func (_e *MockHandlerFunc_Expecter) Execute(ctx interface{}) *MockHandlerFunc_Execute_Call

Execute is a helper method to define mock.On call

  • ctx Context

type MockResponseWriter

type MockResponseWriter struct {
	mock.Mock
}

MockResponseWriter is an autogenerated mock type for the ResponseWriter type

func NewMockResponseWriter

func NewMockResponseWriter(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockResponseWriter

NewMockResponseWriter creates a new instance of MockResponseWriter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockResponseWriter) CloseNotify

func (_m *MockResponseWriter) CloseNotify() <-chan bool

CloseNotify provides a mock function with no fields

func (*MockResponseWriter) EXPECT

func (*MockResponseWriter) Flush

func (_m *MockResponseWriter) Flush()

Flush provides a mock function with no fields

func (*MockResponseWriter) Header

func (_m *MockResponseWriter) Header() http.Header

Header provides a mock function with no fields

func (*MockResponseWriter) Hijack

func (_m *MockResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)

Hijack provides a mock function with no fields

func (*MockResponseWriter) Pusher

func (_m *MockResponseWriter) Pusher() http.Pusher

Pusher provides a mock function with no fields

func (*MockResponseWriter) Size

func (_m *MockResponseWriter) Size() int

Size provides a mock function with no fields

func (*MockResponseWriter) Status

func (_m *MockResponseWriter) Status() int

Status provides a mock function with no fields

func (*MockResponseWriter) Write

func (_m *MockResponseWriter) Write(_a0 []byte) (int, error)

Write provides a mock function with given fields: _a0

func (*MockResponseWriter) WriteHeader

func (_m *MockResponseWriter) WriteHeader(statusCode int)

WriteHeader provides a mock function with given fields: statusCode

func (*MockResponseWriter) WriteHeaderNow

func (_m *MockResponseWriter) WriteHeaderNow()

WriteHeaderNow provides a mock function with no fields

func (*MockResponseWriter) WriteString

func (_m *MockResponseWriter) WriteString(_a0 string) (int, error)

WriteString provides a mock function with given fields: _a0

func (*MockResponseWriter) Written

func (_m *MockResponseWriter) Written() bool

Written provides a mock function with no fields

type MockResponseWriter_CloseNotify_Call

type MockResponseWriter_CloseNotify_Call struct {
	*mock.Call
}

MockResponseWriter_CloseNotify_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CloseNotify'

func (*MockResponseWriter_CloseNotify_Call) Return

func (*MockResponseWriter_CloseNotify_Call) Run

func (*MockResponseWriter_CloseNotify_Call) RunAndReturn

type MockResponseWriter_Expecter

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

func (*MockResponseWriter_Expecter) CloseNotify

CloseNotify is a helper method to define mock.On call

func (*MockResponseWriter_Expecter) Flush

Flush is a helper method to define mock.On call

func (*MockResponseWriter_Expecter) Header

Header is a helper method to define mock.On call

func (*MockResponseWriter_Expecter) Hijack

Hijack is a helper method to define mock.On call

func (*MockResponseWriter_Expecter) Pusher

Pusher is a helper method to define mock.On call

func (*MockResponseWriter_Expecter) Size

Size is a helper method to define mock.On call

func (*MockResponseWriter_Expecter) Status

Status is a helper method to define mock.On call

func (*MockResponseWriter_Expecter) Write

func (_e *MockResponseWriter_Expecter) Write(_a0 interface{}) *MockResponseWriter_Write_Call

Write is a helper method to define mock.On call

  • _a0 []byte

func (*MockResponseWriter_Expecter) WriteHeader

func (_e *MockResponseWriter_Expecter) WriteHeader(statusCode interface{}) *MockResponseWriter_WriteHeader_Call

WriteHeader is a helper method to define mock.On call

  • statusCode int

func (*MockResponseWriter_Expecter) WriteHeaderNow

WriteHeaderNow is a helper method to define mock.On call

func (*MockResponseWriter_Expecter) WriteString

func (_e *MockResponseWriter_Expecter) WriteString(_a0 interface{}) *MockResponseWriter_WriteString_Call

WriteString is a helper method to define mock.On call

  • _a0 string

func (*MockResponseWriter_Expecter) Written

Written is a helper method to define mock.On call

type MockResponseWriter_Flush_Call

type MockResponseWriter_Flush_Call struct {
	*mock.Call
}

MockResponseWriter_Flush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Flush'

func (*MockResponseWriter_Flush_Call) Return

func (*MockResponseWriter_Flush_Call) Run

func (*MockResponseWriter_Flush_Call) RunAndReturn

func (_c *MockResponseWriter_Flush_Call) RunAndReturn(run func()) *MockResponseWriter_Flush_Call

type MockResponseWriter_Header_Call

type MockResponseWriter_Header_Call struct {
	*mock.Call
}

MockResponseWriter_Header_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Header'

func (*MockResponseWriter_Header_Call) Return

func (*MockResponseWriter_Header_Call) Run

func (*MockResponseWriter_Header_Call) RunAndReturn

type MockResponseWriter_Hijack_Call

type MockResponseWriter_Hijack_Call struct {
	*mock.Call
}

MockResponseWriter_Hijack_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Hijack'

func (*MockResponseWriter_Hijack_Call) Return

func (*MockResponseWriter_Hijack_Call) Run

func (*MockResponseWriter_Hijack_Call) RunAndReturn

type MockResponseWriter_Pusher_Call

type MockResponseWriter_Pusher_Call struct {
	*mock.Call
}

MockResponseWriter_Pusher_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pusher'

func (*MockResponseWriter_Pusher_Call) Return

func (*MockResponseWriter_Pusher_Call) Run

func (*MockResponseWriter_Pusher_Call) RunAndReturn

type MockResponseWriter_Size_Call

type MockResponseWriter_Size_Call struct {
	*mock.Call
}

MockResponseWriter_Size_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Size'

func (*MockResponseWriter_Size_Call) Return

func (*MockResponseWriter_Size_Call) Run

func (*MockResponseWriter_Size_Call) RunAndReturn

func (_c *MockResponseWriter_Size_Call) RunAndReturn(run func() int) *MockResponseWriter_Size_Call

type MockResponseWriter_Status_Call

type MockResponseWriter_Status_Call struct {
	*mock.Call
}

MockResponseWriter_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status'

func (*MockResponseWriter_Status_Call) Return

func (*MockResponseWriter_Status_Call) Run

func (*MockResponseWriter_Status_Call) RunAndReturn

type MockResponseWriter_WriteHeaderNow_Call

type MockResponseWriter_WriteHeaderNow_Call struct {
	*mock.Call
}

MockResponseWriter_WriteHeaderNow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteHeaderNow'

func (*MockResponseWriter_WriteHeaderNow_Call) Return

func (*MockResponseWriter_WriteHeaderNow_Call) Run

func (*MockResponseWriter_WriteHeaderNow_Call) RunAndReturn

type MockResponseWriter_WriteHeader_Call

type MockResponseWriter_WriteHeader_Call struct {
	*mock.Call
}

MockResponseWriter_WriteHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteHeader'

func (*MockResponseWriter_WriteHeader_Call) Return

func (*MockResponseWriter_WriteHeader_Call) Run

func (*MockResponseWriter_WriteHeader_Call) RunAndReturn

type MockResponseWriter_WriteString_Call

type MockResponseWriter_WriteString_Call struct {
	*mock.Call
}

MockResponseWriter_WriteString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteString'

func (*MockResponseWriter_WriteString_Call) Return

func (*MockResponseWriter_WriteString_Call) Run

func (*MockResponseWriter_WriteString_Call) RunAndReturn

type MockResponseWriter_Write_Call

type MockResponseWriter_Write_Call struct {
	*mock.Call
}

MockResponseWriter_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write'

func (*MockResponseWriter_Write_Call) Return

func (*MockResponseWriter_Write_Call) Run

func (*MockResponseWriter_Write_Call) RunAndReturn

func (_c *MockResponseWriter_Write_Call) RunAndReturn(run func([]byte) (int, error)) *MockResponseWriter_Write_Call

type MockResponseWriter_Written_Call

type MockResponseWriter_Written_Call struct {
	*mock.Call
}

MockResponseWriter_Written_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Written'

func (*MockResponseWriter_Written_Call) Return

func (*MockResponseWriter_Written_Call) Run

func (*MockResponseWriter_Written_Call) RunAndReturn

type MockRouter

type MockRouter struct {
	mock.Mock
}

MockRouter is an autogenerated mock type for the Router type

func NewMockRouter

func NewMockRouter(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockRouter

NewMockRouter creates a new instance of MockRouter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockRouter) Delete

func (_m *MockRouter) Delete(relativePath string, handler ErrHandlerFunc)

Delete provides a mock function with given fields: relativePath, handler

func (*MockRouter) EXPECT

func (_m *MockRouter) EXPECT() *MockRouter_Expecter

func (*MockRouter) Get

func (_m *MockRouter) Get(relativePath string, handler ErrHandlerFunc)

Get provides a mock function with given fields: relativePath, handler

func (*MockRouter) Group

func (_m *MockRouter) Group(relativePath string, routerFunc func(Router))

Group provides a mock function with given fields: relativePath, routerFunc

func (*MockRouter) Handle

func (_m *MockRouter) Handle(method string, relativePath string, handler ErrHandlerFunc)

Handle provides a mock function with given fields: method, relativePath, handler

func (*MockRouter) Patch

func (_m *MockRouter) Patch(relativePath string, handler ErrHandlerFunc)

Patch provides a mock function with given fields: relativePath, handler

func (*MockRouter) Post

func (_m *MockRouter) Post(relativePath string, handler ErrHandlerFunc)

Post provides a mock function with given fields: relativePath, handler

func (*MockRouter) Put

func (_m *MockRouter) Put(relativePath string, handler ErrHandlerFunc)

Put provides a mock function with given fields: relativePath, handler

func (*MockRouter) Use

func (_m *MockRouter) Use(middleware ...func(Context))

Use provides a mock function with given fields: middleware

type MockRouter_Delete_Call

type MockRouter_Delete_Call struct {
	*mock.Call
}

MockRouter_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'

func (*MockRouter_Delete_Call) Return

func (*MockRouter_Delete_Call) Run

func (_c *MockRouter_Delete_Call) Run(run func(relativePath string, handler ErrHandlerFunc)) *MockRouter_Delete_Call

func (*MockRouter_Delete_Call) RunAndReturn

type MockRouter_Expecter

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

func (*MockRouter_Expecter) Delete

func (_e *MockRouter_Expecter) Delete(relativePath interface{}, handler interface{}) *MockRouter_Delete_Call

Delete is a helper method to define mock.On call

  • relativePath string
  • handler ErrHandlerFunc

func (*MockRouter_Expecter) Get

func (_e *MockRouter_Expecter) Get(relativePath interface{}, handler interface{}) *MockRouter_Get_Call

Get is a helper method to define mock.On call

  • relativePath string
  • handler ErrHandlerFunc

func (*MockRouter_Expecter) Group

func (_e *MockRouter_Expecter) Group(relativePath interface{}, routerFunc interface{}) *MockRouter_Group_Call

Group is a helper method to define mock.On call

  • relativePath string
  • routerFunc func(Router)

func (*MockRouter_Expecter) Handle

func (_e *MockRouter_Expecter) Handle(method interface{}, relativePath interface{}, handler interface{}) *MockRouter_Handle_Call

Handle is a helper method to define mock.On call

  • method string
  • relativePath string
  • handler ErrHandlerFunc

func (*MockRouter_Expecter) Patch

func (_e *MockRouter_Expecter) Patch(relativePath interface{}, handler interface{}) *MockRouter_Patch_Call

Patch is a helper method to define mock.On call

  • relativePath string
  • handler ErrHandlerFunc

func (*MockRouter_Expecter) Post

func (_e *MockRouter_Expecter) Post(relativePath interface{}, handler interface{}) *MockRouter_Post_Call

Post is a helper method to define mock.On call

  • relativePath string
  • handler ErrHandlerFunc

func (*MockRouter_Expecter) Put

func (_e *MockRouter_Expecter) Put(relativePath interface{}, handler interface{}) *MockRouter_Put_Call

Put is a helper method to define mock.On call

  • relativePath string
  • handler ErrHandlerFunc

func (*MockRouter_Expecter) Use

func (_e *MockRouter_Expecter) Use(middleware ...interface{}) *MockRouter_Use_Call

Use is a helper method to define mock.On call

  • middleware ...func(Context)

type MockRouter_Get_Call

type MockRouter_Get_Call struct {
	*mock.Call
}

MockRouter_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'

func (*MockRouter_Get_Call) Return

func (*MockRouter_Get_Call) Run

func (_c *MockRouter_Get_Call) Run(run func(relativePath string, handler ErrHandlerFunc)) *MockRouter_Get_Call

func (*MockRouter_Get_Call) RunAndReturn

func (_c *MockRouter_Get_Call) RunAndReturn(run func(string, ErrHandlerFunc)) *MockRouter_Get_Call

type MockRouter_Group_Call

type MockRouter_Group_Call struct {
	*mock.Call
}

MockRouter_Group_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Group'

func (*MockRouter_Group_Call) Return

func (*MockRouter_Group_Call) Run

func (_c *MockRouter_Group_Call) Run(run func(relativePath string, routerFunc func(Router))) *MockRouter_Group_Call

func (*MockRouter_Group_Call) RunAndReturn

func (_c *MockRouter_Group_Call) RunAndReturn(run func(string, func(Router))) *MockRouter_Group_Call

type MockRouter_Handle_Call

type MockRouter_Handle_Call struct {
	*mock.Call
}

MockRouter_Handle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Handle'

func (*MockRouter_Handle_Call) Return

func (*MockRouter_Handle_Call) Run

func (_c *MockRouter_Handle_Call) Run(run func(method string, relativePath string, handler ErrHandlerFunc)) *MockRouter_Handle_Call

func (*MockRouter_Handle_Call) RunAndReturn

type MockRouter_Patch_Call

type MockRouter_Patch_Call struct {
	*mock.Call
}

MockRouter_Patch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Patch'

func (*MockRouter_Patch_Call) Return

func (*MockRouter_Patch_Call) Run

func (_c *MockRouter_Patch_Call) Run(run func(relativePath string, handler ErrHandlerFunc)) *MockRouter_Patch_Call

func (*MockRouter_Patch_Call) RunAndReturn

func (_c *MockRouter_Patch_Call) RunAndReturn(run func(string, ErrHandlerFunc)) *MockRouter_Patch_Call

type MockRouter_Post_Call

type MockRouter_Post_Call struct {
	*mock.Call
}

MockRouter_Post_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Post'

func (*MockRouter_Post_Call) Return

func (*MockRouter_Post_Call) Run

func (_c *MockRouter_Post_Call) Run(run func(relativePath string, handler ErrHandlerFunc)) *MockRouter_Post_Call

func (*MockRouter_Post_Call) RunAndReturn

func (_c *MockRouter_Post_Call) RunAndReturn(run func(string, ErrHandlerFunc)) *MockRouter_Post_Call

type MockRouter_Put_Call

type MockRouter_Put_Call struct {
	*mock.Call
}

MockRouter_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put'

func (*MockRouter_Put_Call) Return

func (*MockRouter_Put_Call) Run

func (_c *MockRouter_Put_Call) Run(run func(relativePath string, handler ErrHandlerFunc)) *MockRouter_Put_Call

func (*MockRouter_Put_Call) RunAndReturn

func (_c *MockRouter_Put_Call) RunAndReturn(run func(string, ErrHandlerFunc)) *MockRouter_Put_Call

type MockRouter_Use_Call

type MockRouter_Use_Call struct {
	*mock.Call
}

MockRouter_Use_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Use'

func (*MockRouter_Use_Call) Return

func (*MockRouter_Use_Call) Run

func (_c *MockRouter_Use_Call) Run(run func(middleware ...func(Context))) *MockRouter_Use_Call

func (*MockRouter_Use_Call) RunAndReturn

func (_c *MockRouter_Use_Call) RunAndReturn(run func(...func(Context))) *MockRouter_Use_Call

type MockServiceRegistrar

type MockServiceRegistrar struct {
	mock.Mock
}

MockServiceRegistrar is an autogenerated mock type for the ServiceRegistrar type

func NewMockServiceRegistrar

func NewMockServiceRegistrar(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockServiceRegistrar

NewMockServiceRegistrar creates a new instance of MockServiceRegistrar. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockServiceRegistrar) EXPECT

func (*MockServiceRegistrar) RegisterService

func (_m *MockServiceRegistrar) RegisterService(desc *grpc.ServiceDesc, impl any)

RegisterService provides a mock function with given fields: desc, impl

type MockServiceRegistrar_Expecter

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

func (*MockServiceRegistrar_Expecter) RegisterService

func (_e *MockServiceRegistrar_Expecter) RegisterService(desc interface{}, impl interface{}) *MockServiceRegistrar_RegisterService_Call

RegisterService is a helper method to define mock.On call

  • desc *grpc.ServiceDesc
  • impl any

type MockServiceRegistrar_RegisterService_Call

type MockServiceRegistrar_RegisterService_Call struct {
	*mock.Call
}

MockServiceRegistrar_RegisterService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterService'

func (*MockServiceRegistrar_RegisterService_Call) Return

func (*MockServiceRegistrar_RegisterService_Call) Run

func (*MockServiceRegistrar_RegisterService_Call) RunAndReturn

type ResponseWriter

type ResponseWriter interface {
	http.ResponseWriter
	http.Hijacker
	http.Flusher
	http.CloseNotifier

	// Status returns the HTTP response status code of the current request.
	Status() int

	// Size returns the number of bytes already written into the response http body.
	// See Written()
	Size() int

	// WriteString writes the string into the response body.
	WriteString(string) (int, error)

	// Written returns true if the response body was already written.
	Written() bool

	// WriteHeaderNow forces to write the http header (status code + headers).
	WriteHeaderNow()

	// Pusher get the http.Pusher for server push
	Pusher() http.Pusher
}

ResponseWriter copy from gin.ResponseWriter

type Router

type Router interface {
	Use(middleware ...func(ctx Context))

	Handle(method string, relativePath string, handler ErrHandlerFunc)

	Get(relativePath string, handler ErrHandlerFunc)

	Post(relativePath string, handler ErrHandlerFunc)

	Put(relativePath string, handler ErrHandlerFunc)

	Patch(relativePath string, handler ErrHandlerFunc)

	Delete(relativePath string, handler ErrHandlerFunc)

	Group(relativePath string, routerFunc func(Router))
}

func NewRouter

func NewRouter() (Router, http.Handler)

func NewTestRoute

func NewTestRoute(w http.ResponseWriter) (Router, func(func(Context)))

type Server

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

func NewHttpServer

func NewHttpServer(ctx context.Context, addr string, setupRouteFunc func(Router), opts ...func(*Server)) Server

NewHttpServer creates new http server

func (*Server) Run

func (srv *Server) Run() error

Run starts http server and listen for syscall kill (no param) default send syscall.SIGTERM kill -2 is syscall.SIGINT kill -9 is syscall. SIGKILL but can"t be catch, so don't need add it

func (*Server) RunWithContext

func (srv *Server) RunWithContext(ctx context.Context) error

RunWithContext starts http server and manages its lifecycle using given context

type ServiceRegistrar

type ServiceRegistrar interface {
	RegisterService(desc *grpc.ServiceDesc, impl any)
}

Directories

Path Synopsis
caching
Package jwt provided method for signing and verify JWT
Package jwt provided method for signing and verify JWT
middleware
mocks

Jump to

Keyboard shortcuts

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