runtime

package
v0.0.0-...-0dcf97e Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSessionKey

func GenerateSessionKey(algorithm string, step rsa_blind.RSAStep) string

func GetExistingStringAndIndex

func GetExistingStringAndIndex(raw []interface{}) ([]string, []int)

func ReadSchema

func ReadSchema(filename string) (string, error)

Types

type ChannelConn

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

func NewChannelConn

func NewChannelConn(ch chan []byte) *ChannelConn

func (*ChannelConn) Close

func (conn *ChannelConn) Close()

func (*ChannelConn) Read

func (conn *ChannelConn) Read(buffer []byte) (int, error)

func (*ChannelConn) Write

func (conn *ChannelConn) Write(val []byte) (int, error)

type Conn

type Conn interface {
	Write(val []byte) (int, error)
	Read(buf []byte) (int, error)
	Close()
}

type Consumer

type Consumer interface {
	Receive() ([]byte, error)
	ReceiveStruct() (Message, error)
	Close()
}

type KV

type KV interface {
	// TODO(zhuzilin) Currently, the go-redis library will return string by default.
	// Find a way to return correct type of the val.
	Put(key string, val string) error
	Get(key string) (string, error)
	Del(key string) error

	HashPut(key string, data map[string]string) error
	HashGet(key, field string) (string, error)
	HashMultiGet(key string, fields []string) ([]interface{}, error)
	HashDel(key string, fields []string) error

	SetAdd(key string, members []string) error
	SetCheck(key string, members []string) ([]bool, error)
	SetDel(key string, members []string) error
}

type Key

type Key struct {
	N []byte `json:"n"`
	E int    `json:"e"`
}

type Message

type Message struct {
	Algorithm  string            `json:"algorithm"`
	Step       rsa_blind.RSAStep `json:"step"`
	SessionKey string            `json:"session_key"`
	Data       [][]byte          `json:"data"`
	Key        Key               `json:"key"`
}

type Producer

type Producer interface {
	Send(payload []byte) error
	SendStruct(msg *Message) error
	GetConnectionInfo() string
	Close()
}

type PulsarConsumer

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

func NewPulsarConsumer

func NewPulsarConsumer(URL string, topic string, schema *string) (*PulsarConsumer, error)

func (*PulsarConsumer) Close

func (c *PulsarConsumer) Close()

func (*PulsarConsumer) Receive

func (c *PulsarConsumer) Receive() ([]byte, error)

func (*PulsarConsumer) ReceiveStruct

func (c *PulsarConsumer) ReceiveStruct() (Message, error)

type PulsarProducer

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

func NewPulsarProducer

func NewPulsarProducer(URL string, topic string, schema *string) (*PulsarProducer, error)

func (*PulsarProducer) Close

func (p *PulsarProducer) Close()

func (*PulsarProducer) GetConnectionInfo

func (p *PulsarProducer) GetConnectionInfo() string

func (*PulsarProducer) Send

func (p *PulsarProducer) Send(payload []byte) error

func (*PulsarProducer) SendStruct

func (p *PulsarProducer) SendStruct(msg *Message) error

type RedisKV

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

func NewRedisKV

func NewRedisKV(url, password string, db int) *RedisKV

func (*RedisKV) Del

func (kv *RedisKV) Del(key string) error

func (*RedisKV) Get

func (kv *RedisKV) Get(key string) (string, error)

func (*RedisKV) HashDel

func (kv *RedisKV) HashDel(key string, fields []string) error

func (*RedisKV) HashGet

func (kv *RedisKV) HashGet(key, field string) (string, error)

func (*RedisKV) HashMultiGet

func (kv *RedisKV) HashMultiGet(key string, fields []string) ([]interface{}, error)

func (*RedisKV) HashPut

func (kv *RedisKV) HashPut(key string, data map[string]string) error

func (*RedisKV) Put

func (kv *RedisKV) Put(key string, val string) error

func (*RedisKV) SetAdd

func (kv *RedisKV) SetAdd(key string, members []string) error

func (*RedisKV) SetCheck

func (kv *RedisKV) SetCheck(key string, members []string) ([]bool, error)

func (*RedisKV) SetDel

func (kv *RedisKV) SetDel(key string, members []string) error

Jump to

Keyboard shortcuts

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