gdsb

package module
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

README

General Data Stream Builder (GDSB) Build Status Go Report Card

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CassandraSession *gocql.Session

CassandraSession holds cassandra sessions

View Source
var RedisClient *redis.Client

RedisClient is redis client

Functions

func CQUpsert

func CQUpsert(c CassandraQuery) error

CQUpsert will execute the CassandraQuery passed

func CassandraSessionInit

func CassandraSessionInit(c CassandraConfig) error

CassandraSessionInit will load cassandra session

func CreateCassandraConnection

func CreateCassandraConnection(c CassandraConfig) (*gocql.Session, error)

CreateCassandraConnection creates cassandra session

func CreateClient

func CreateClient(config RedisConfig) *redis.Client

CreateClient will create normal client

func CreateKafkaConsumer

func CreateKafkaConsumer(conf KafkaConf) (*kafka.Consumer, error)

CreateKafkaConsumer creates kafka consumers

func CreateKafkaProducer

func CreateKafkaProducer(conf KafkaConf) (*kafka.Producer, error)

CreateKafkaProducer creates Kaka Producer

func CreateKafkaSubscription

func CreateKafkaSubscription(conf KafkaConf, topics []string, ch chan KafkaMessage) error

CreateKafkaSubscription will create kafka consumer and startsubcripton to a channel

func CreateRedisClient

func CreateRedisClient(config RedisConfig) *redis.Client

CreateRedisClient creates redis client

func CreateSentinelConnection

func CreateSentinelConnection(config RedisConfig) *redis.Client

CreateSentinelConnection for creating Sentinel connection

func HeartbeatHandler added in v1.2.2

func HeartbeatHandler(w http.ResponseWriter, r *http.Request)

HeartbeatHandler for handeling

func HeartbeatResponseService added in v1.2.2

func HeartbeatResponseService(address string) error

HeartbeatResponseService will start a app info service for

func Hold

func Hold()

Hold will hold execution

func InitKafkaProducer

func InitKafkaProducer(conf KafkaConf) error

InitKafkaProducer creates Kaka Producer

func LoadConfigurations

func LoadConfigurations(c Configuration) error

LoadConfigurations loads configurations

func LoadConfigurationsFromDir added in v1.0.1

func LoadConfigurationsFromDir(resourcesDir string, configuration Configuration) error

LoadConfigurationsFromDir Load Configurations From Dir

func LoadRedisClient

func LoadRedisClient(config RedisConfig)

LoadRedisClient load redis client configuration

func Produce

func Produce(msg KfMsg) error

Produce will produce to kafka topic with if key passed. if the key passed is empty random uuid will be created

func ToJSON

func ToJSON(o interface{}) (string, error)

ToJSON takes object o and returns string and error

func UTCMilisec

func UTCMilisec() int64

UTCMilisec is to generate utc time millisecond

func UTCNow

func UTCNow() time.Time

UTCNow is to generate utc time

func UUIDstring

func UUIDstring() string

UUIDstring to generate UUID

Types

type CassandraConfig

type CassandraConfig struct {
	Hosts    string
	Port     int
	Username string
	Password string
	Keyspace string
	Timeout  int
}

CassandraConfig is the cassandra configuration object

type CassandraQuery

type CassandraQuery struct {
	Querry string
}

CassandraQuery holds the query to be run

type Configuration

type Configuration struct {
	Config  interface{}
	EnvName string
}

Configuration holds Config interface to be loaded and config validator

type KafkaConf

type KafkaConf struct {
	Config     []string
	KeyEnabled bool
}

KafkaConf Kafka configuration

type KafkaMessage

type KafkaMessage struct {
	Offset         kafka.Offset
	Message        string
	MessageBytes   []byte
	PartitionIndex int32
	Key            string
}

KafkaMessage is wrapper of kafka messages

type KfMsg

type KfMsg struct {
	Topic   string
	Key     string
	Message string
	Object  interface{}
}

KfMsg is new kafka message that need to be inserted

type RedisConfig

type RedisConfig struct {
	ClientType string
	Master     string
	Hosts      string
	Password   string
	DB         int
}

RedisConfig holds configuration for redisclient creation.

type ServerConfig added in v1.2.2

type ServerConfig struct {
	WriteTimeoutInMili int32
	ReadTimeoutInMili  int32
	Address            string
}

ServerConfig is for the server Configurations

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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