command_utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandMessage

type CommandMessage struct {
	Data    interface{}
	Message string
	Status  CommandStatus
	Hash    string
}

func NewCommandMessage

func NewCommandMessage(message string, status CommandStatus, data interface{}) *CommandMessage

func (*CommandMessage) GetError

func (c *CommandMessage) GetError() error

type CommandStatus

type CommandStatus string
const (
	SuccessStatus             CommandStatus = "success"
	NotFoundErrorStatus       CommandStatus = "not found"
	ValidationErrorStatus     CommandStatus = "validation error"
	DuplicateErrorStatus      CommandStatus = "duplication error"
	UNAuthorizedStatus        CommandStatus = "unauthorized"
	InternalServerErrorStatus CommandStatus = "internal server error"
)

func GetCommandStatusFromError

func GetCommandStatusFromError(err error) CommandStatus

Jump to

Keyboard shortcuts

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