resp

package
v0.0.0-...-bcdc46a Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OK = NewStrResponse("OK")
View Source
var PONG = NewStrResponse("PONG")

Functions

func NewAsyncResponse

func NewAsyncResponse(asyncID string, resp apis.IResponse) apis.IResponse

Types

type AsyncResponse

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

func (*AsyncResponse) IsError

func (r *AsyncResponse) IsError() bool

func (*AsyncResponse) StringResponse

func (r *AsyncResponse) StringResponse() string

func (*AsyncResponse) WriteResponse

func (r *AsyncResponse) WriteResponse(buf *bufio.Writer) error

type DictResponse

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

func NewDictResponse

func NewDictResponse(header string, dict map[string]interface{}) *DictResponse

func (*DictResponse) GetDict

func (r *DictResponse) GetDict() map[string]interface{}

func (*DictResponse) IsError

func (r *DictResponse) IsError() bool

func (*DictResponse) StringResponse

func (r *DictResponse) StringResponse() string

func (*DictResponse) WriteResponse

func (r *DictResponse) WriteResponse(buf *bufio.Writer) error

type IntResponse

type IntResponse struct {
	Value int64
}

IntResponse is a simple integer response.

func NewIntResponse

func NewIntResponse(val int64) *IntResponse

func (*IntResponse) IsError

func (r *IntResponse) IsError() bool

func (*IntResponse) StringResponse

func (r *IntResponse) StringResponse() string

func (*IntResponse) WriteResponse

func (r *IntResponse) WriteResponse(buf *bufio.Writer) error

type MessagesResponse

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

func NewItemsResponse

func NewItemsResponse(items []apis.IResponseItem) *MessagesResponse

func (*MessagesResponse) GetItems

func (r *MessagesResponse) GetItems() []apis.IResponseItem

func (*MessagesResponse) IsError

func (r *MessagesResponse) IsError() bool

func (*MessagesResponse) StringResponse

func (r *MessagesResponse) StringResponse() string

func (*MessagesResponse) WriteResponse

func (r *MessagesResponse) WriteResponse(buf *bufio.Writer) error

type StrArrayResponse

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

StrArrayResponse a response containing array of strings.

func NewStrArrayResponse

func NewStrArrayResponse(header string, val []string) *StrArrayResponse

func (*StrArrayResponse) IsError

func (r *StrArrayResponse) IsError() bool

func (*StrArrayResponse) StringResponse

func (r *StrArrayResponse) StringResponse() string

func (*StrArrayResponse) WriteResponse

func (r *StrArrayResponse) WriteResponse(buf *bufio.Writer) error

type StrResponse

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

StrResponse is a simple string response used to return some quick responses for commands like ping, etc.

func NewAsyncAccept

func NewAsyncAccept(data string) *StrResponse

func NewStrResponse

func NewStrResponse(data string) *StrResponse

func (*StrResponse) IsError

func (r *StrResponse) IsError() bool

func (*StrResponse) StringResponse

func (r *StrResponse) StringResponse() string

func (*StrResponse) WriteResponse

func (r *StrResponse) WriteResponse(buf *bufio.Writer) error

Jump to

Keyboard shortcuts

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