dedb_client_go

package module
v0.0.0-...-bc27793 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

README

dedb-client-go

Go client for DeDB

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(entity proto.Message, data string) error

func Encode

func Encode(entity proto.Message) (string, error)

Types

type Client

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

func NewClient

func NewClient(config ClientConfig) (*Client, error)

func (*Client) Ack

func (c *Client) Ack(ctx context.Context, eventId string)

func (*Client) Close

func (c *Client) Close()

func (*Client) Connect

func (c *Client) Connect(ctx context.Context) error

func (*Client) GetDomain

func (c *Client) GetDomain(ctx context.Context, request *api.GetDomainRequest) (*api.GetResponse, error)

func (*Client) GetDomainIds

func (c *Client) GetDomainIds(ctx context.Context, request *api.GetDomainIdsRequest) (*api.GetDomainIdsResponse, error)

func (*Client) Save

func (c *Client) Save(ctx context.Context, request *api.SaveRequest) (*api.SaveResponse, error)

type ClientConfig

type ClientConfig struct {
	RedisDbConfig     RedisDbConfig
	RedisSearchConfig RedisSearchConfig
	Server            string
	Streams           []string
	StreamIds         map[string]string
	ConsumerGroup     string
	EventChannel      chan<- *api.Event
	ErrorChannel      chan<- error
}

type RedisDbConfig

type RedisDbConfig struct {
	DbAddress     string `envconfig:"DEDB_REDIS_DB_ADDRESS"`
	Username      string `envconfig:"DEDB_REDIS_DB_USERNAME"`
	Password      string `envconfig:"DEDB_REDIS_DB_PASSWORD"`
	RedisCa       string `envconfig:"DEDB_REDIS_DB_CA"`
	RedisUserCert string `envconfig:"DEDB_REDIS_DB_USER_CERT"`
	RedisUserKey  string `envconfig:"DEDB_REDIS_DB_USER_KEY"`
	Index         string `envconfig:"DEDB_REDIS_DB_INDEX"`
	MinIdle       int    `envconfig:"DEDB_REDIS_DB_MINIDLE"`
	MaxActive     int    `envconfig:"DEDB_REDIS_DB_MAXACTIVE"`
	IdleTimeout   int64  `envconfig:"DEDB_REDIS_DB_IDLE_TIMEOUT"`
	DbIndex       int    `envconfig:"DEDB_REDIS_DB_DB_INDEX"`
}

type RedisSearchConfig

type RedisSearchConfig struct {
	DbAddress     string `envconfig:"REDIS_SEARCH_DB_ADDRESS"`
	Username      string `envconfig:"REDIS_SEARCH_DB_USERNAME"`
	Password      string `envconfig:"REDIS_SEARCH_PASSWORD"`
	RedisCa       string `envconfig:"REDIS_SEARCH_CA"`
	RedisUserCert string `envconfig:"REDIS_SEARCH_USER_CERT"`
	RedisUserKey  string `envconfig:"REDIS_SEARCH_USER_KEY"`
	Index         string `envconfig:"REDIS_SEARCH_INDEX"`
	MinIdle       int    `envconfig:"REDIS_SEARCH_MINIDLE"`
	MaxActive     int    `envconfig:"REDIS_SEARCH_MAXACTIVE"`
	IdleTimeout   int64  `envconfig:"REDIS_SEARCH_IDLE_TIMEOUT"`
	DbIndex       int    `envconfig:"REDIS_SEARCH_DB_INDEX"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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