resdis

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: MIT Imports: 5 Imported by: 0

README

Resdis

It's the go implementation of a redis request-response library.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(address, password string) *Client

func (*Client) Subscribe

func (client *Client) Subscribe(ctx context.Context, channel string) chan Request

type Request

type Request struct {
	Timestamp int64  `json:"timestamp"`
	Channel   string `json:"channel"`
	Body      string `json:"body"`
	RespondTo string `json:"respondTo"`
	Timeout   int64  `json:"timeout"`
}

func NewRequest

func NewRequest(channel string, body string, timeout int64) *Request

func (*Request) Respond

func (req *Request) Respond(ctx context.Context, client *Client, body string) (int64, error)

func (*Request) Send

func (req *Request) Send(ctx context.Context, client *Client) (*Response, error)

type Response

type Response struct {
	Timestamp int64   `json:"timestamp"`
	Request   Request `json:"request"`
	Body      string  `json:"body"`
}

Jump to

Keyboard shortcuts

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