redis

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KeyResponseTopic 响应主题metadataKey
	KeyResponseTopic = "responseTopic"
	// KeyResponseChannel 响应主题metadataKey
	KeyResponseChannel = "responseChannel"
)
View Source
const Type = types.EndpointTypePrefix + "redis"

Type 组件类型

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Redis服务器地址
	Server string
	// Redis密码
	Password string
	// Redis数据库index
	Db int
}

type Endpoint

type Endpoint = Redis

Endpoint 别名

type Redis

type Redis struct {
	impl.BaseEndpoint
	base.SharedNode[*redis.Client]
	RuleConfig types.Config
	//Config 配置
	Config Config
	// contains filtered or unexported fields
}

Redis Redis接收端端点

func (*Redis) AddRouter

func (x *Redis) AddRouter(router endpointApi.Router, params ...interface{}) (string, error)

func (*Redis) Close

func (x *Redis) Close() error

func (*Redis) Destroy

func (x *Redis) Destroy()

Destroy 销毁

func (*Redis) Id

func (x *Redis) Id() string

func (*Redis) Init

func (x *Redis) Init(ruleConfig types.Config, configuration types.Configuration) error

Init 初始化

func (*Redis) New

func (x *Redis) New() types.Node

func (*Redis) Printf

func (x *Redis) Printf(format string, v ...interface{})

func (*Redis) RemoveRouter

func (x *Redis) RemoveRouter(routerId string, params ...interface{}) error

func (*Redis) Start

func (x *Redis) Start() error

func (*Redis) Type

func (x *Redis) Type() string

Type 组件类型

type RequestMessage

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

RequestMessage 请求消息

func (*RequestMessage) Body

func (r *RequestMessage) Body() []byte

func (*RequestMessage) From

func (r *RequestMessage) From() string

func (*RequestMessage) GetError

func (r *RequestMessage) GetError() error

func (*RequestMessage) GetMsg

func (r *RequestMessage) GetMsg() *types.RuleMsg

func (*RequestMessage) GetParam

func (r *RequestMessage) GetParam(key string) string

func (*RequestMessage) Headers

func (r *RequestMessage) Headers() textproto.MIMEHeader

func (*RequestMessage) SetBody

func (r *RequestMessage) SetBody(body []byte)

func (*RequestMessage) SetError

func (r *RequestMessage) SetError(err error)

func (*RequestMessage) SetMsg

func (r *RequestMessage) SetMsg(msg *types.RuleMsg)

func (*RequestMessage) SetStatusCode

func (r *RequestMessage) SetStatusCode(statusCode int)

type ResponseMessage

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

ResponseMessage http响应消息

func (*ResponseMessage) Body

func (r *ResponseMessage) Body() []byte

func (*ResponseMessage) From

func (r *ResponseMessage) From() string

func (*ResponseMessage) GetError

func (r *ResponseMessage) GetError() error

func (*ResponseMessage) GetMsg

func (r *ResponseMessage) GetMsg() *types.RuleMsg

func (*ResponseMessage) GetParam

func (r *ResponseMessage) GetParam(key string) string

func (*ResponseMessage) Headers

func (r *ResponseMessage) Headers() textproto.MIMEHeader

func (*ResponseMessage) SetBody

func (r *ResponseMessage) SetBody(body []byte)

func (*ResponseMessage) SetError

func (r *ResponseMessage) SetError(err error)

func (*ResponseMessage) SetMsg

func (r *ResponseMessage) SetMsg(msg *types.RuleMsg)

func (*ResponseMessage) SetStatusCode

func (r *ResponseMessage) SetStatusCode(statusCode int)

Jump to

Keyboard shortcuts

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