servicereply

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 19

README

README

This README would normally document whatever steps are necessary to get your application up and running.

What is this repository for?
  • Quick summary
  • Version
How do I get set up?
  • Summary of set up
  • Configuration
  • Dependencies
  • Database configuration
  • How to run tests
  • Deployment instructions
Contribution guidelines
  • Writing tests
  • Code review
  • Other guidelines
Who do I talk to?
  • Repo owner or admin
  • Other community or team contact

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResponse

type BaseResponse struct {
	Status  status.Status `json:"status"`
	Message *Message      `json:"message,omitempty"`
}

type BaseServiceError

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

func (*BaseServiceError) Error

func (se *BaseServiceError) Error() string

func (*BaseServiceError) GetActionLog

func (se *BaseServiceError) GetActionLog() string

func (*BaseServiceError) GetError

func (se *BaseServiceError) GetError() error

func (*BaseServiceError) GetErrorType

func (se *BaseServiceError) GetErrorType() *types.ReplyType

func (*BaseServiceError) GetLogMessage

func (se *BaseServiceError) GetLogMessage() *string

func (*BaseServiceError) GetLogValues

func (se *BaseServiceError) GetLogValues() ValuesMap

func (*BaseServiceError) GetReplyValues

func (se *BaseServiceError) GetReplyValues() ValuesMap

func (*BaseServiceError) GetSource

func (se *BaseServiceError) GetSource() string

func (*BaseServiceError) GetUserError

func (se *BaseServiceError) GetUserError() string

func (*BaseServiceError) IsSuccess

func (se *BaseServiceError) IsSuccess() bool

func (*BaseServiceError) Parse

func (se *BaseServiceError) Parse(err string) (Response, error)

func (*BaseServiceError) WithError

func (se *BaseServiceError) WithError(err error) ServiceReply

func (*BaseServiceError) WithLogMessage

func (se *BaseServiceError) WithLogMessage(logMessage string) ServiceReply

func (*BaseServiceError) WithLogValues

func (se *BaseServiceError) WithLogValues(logValues ValuesMap) ServiceReply

func (*BaseServiceError) WithReplyValues

func (se *BaseServiceError) WithReplyValues(extraData ValuesMap) ServiceReply

type IResponse

type IResponse interface {
	GetMessageId() *string
	GetMessageValues() *map[string]interface{}
	GetStatus() status.Status
}

type Message

type Message struct {
	Id     string                 `json:"id"`
	Values map[string]interface{} `json:"values"`
}

type Response

type Response struct {
	BaseResponse
	Data interface{} `json:"data,omitempty"`
}

func (Response) GetMessageId

func (r Response) GetMessageId() string

func (Response) GetMessageValues

func (r Response) GetMessageValues() *map[string]interface{}

func (Response) GetStatus

func (r Response) GetStatus() status.Status

type ServiceReply

type ServiceReply interface {
	error
	WithError(error) ServiceReply
	GetError() error
	WithReplyValues(ValuesMap) ServiceReply
	GetReplyValues() ValuesMap
	WithLogMessage(string) ServiceReply
	GetLogMessage() *string
	WithLogValues(ValuesMap) ServiceReply
	GetLogValues() ValuesMap
	GetActionLog() string
	GetSource() string
	GetUserError() string
	GetErrorType() *types.ReplyType
	IsSuccess() bool
}

func NewBadRequestError

func NewBadRequestError(userMessage string) ServiceReply

func NewDbError

func NewDbError(err error) ServiceReply

func NewInternalServiceError

func NewInternalServiceError(err error) ServiceReply

func NewIoError

func NewIoError(err error) ServiceReply

func NewMessage

func NewMessage(userMessage string) ServiceReply

func NewNetworkError

func NewNetworkError(err error) ServiceReply

func NewNil

func NewNil() ServiceReply

func NewNoMatchReply

func NewNoMatchReply(userMessage string) ServiceReply

func NewRejectedReply

func NewRejectedReply(userMessage string) ServiceReply

func NewServiceAuthError

func NewServiceAuthError(userMessage string) ServiceReply

func NewServiceError

func NewServiceError(errType *types.ReplyType, err error, userMessage string, runTimeCaller int) ServiceReply

func NewValidationError added in v0.1.0

func NewValidationError(validationErrors ValidationErrors) ServiceReply

func NewValidationMandatoryRejectedReply

func NewValidationMandatoryRejectedReply(fields []string) ServiceReply

func NewWithReplyHeadersValues

func NewWithReplyHeadersValues(values map[string]string) ServiceReply

type ValidationErrors added in v0.1.0

type ValidationErrors map[string]string

type ValuesMap

type ValuesMap map[string]interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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