Documentation
¶
Index ¶
- Variables
- type ServiceContextImpl
- func (s *ServiceContextImpl[R]) BadRequest() error
- func (s *ServiceContextImpl[R]) Conflict() error
- func (s *ServiceContextImpl[R]) Context() context.Context
- func (s *ServiceContextImpl[R]) ErrorMessage(statusCode int, message string) error
- func (s *ServiceContextImpl[R]) InternalServerError() error
- func (s *ServiceContextImpl[R]) MethodNotAllowed() error
- func (s *ServiceContextImpl[R]) NotFound() error
- func (s *ServiceContextImpl[R]) Response(status int, body R) error
- func (s *ServiceContextImpl[R]) Unauthorized() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( InternalServerError = "Internal server error" BadRequest = "Bad request" NotFound = "Not found" Unimplemented = "Unimplemented" Conflict = "Conflict" )
Functions ¶
This section is empty.
Types ¶
type ServiceContextImpl ¶
type ServiceContextImpl[R any] struct { ResponseData R ResponseStatus int // contains filtered or unexported fields }
func NewServiceContext ¶
func NewServiceContext[R any](ctx context.Context) *ServiceContextImpl[R]
func (*ServiceContextImpl[R]) BadRequest ¶
func (s *ServiceContextImpl[R]) BadRequest() error
func (*ServiceContextImpl[R]) Conflict ¶
func (s *ServiceContextImpl[R]) Conflict() error
func (*ServiceContextImpl[R]) Context ¶
func (s *ServiceContextImpl[R]) Context() context.Context
func (*ServiceContextImpl[R]) ErrorMessage ¶
func (s *ServiceContextImpl[R]) ErrorMessage(statusCode int, message string) error
func (*ServiceContextImpl[R]) InternalServerError ¶
func (s *ServiceContextImpl[R]) InternalServerError() error
func (*ServiceContextImpl[R]) MethodNotAllowed ¶
func (s *ServiceContextImpl[R]) MethodNotAllowed() error
func (*ServiceContextImpl[R]) NotFound ¶
func (s *ServiceContextImpl[R]) NotFound() error
func (*ServiceContextImpl[R]) Response ¶
func (s *ServiceContextImpl[R]) Response(status int, body R) error
func (*ServiceContextImpl[R]) Unauthorized ¶
func (s *ServiceContextImpl[R]) Unauthorized() error
Click to show internal directories.
Click to hide internal directories.