core

package
v0.0.0-...-019737a Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTestConnection

func GetTestConnection() *gorm.DB

GetTestConnection for get face connection

func GetTestConnectionSQL

func GetTestConnectionSQL() *sql.DB

GetTestConnectionSQL funtion sql test

func Register

func Register(model interface{}, serverURL string, index string) (*elastic.Client, error)

Register for registration elastic function

Types

type BulkConfigElastic

type BulkConfigElastic struct {
	Index string
	ID    string
	Doc   interface{}
}

BulkConfigElastic for configuration elastic

type ConncetionRepo

type ConncetionRepo interface {
	GetConn() (*gorm.DB, error)
}

ConncetionRepo for interfacing

type Connection

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

Connection struct

func NewServiceConnection

func NewServiceConnection(driver, host string, port int, user, password, dbname string) *Connection

NewServiceConnection return a struct connection

func (*Connection) GetConn

func (conn *Connection) GetConn() (*gorm.DB, error)

GetConn for get connection

type ElasticCore

type ElasticCore struct {
	Model  interface{}
	Index  string
	Client *elastic.Client
}

ElasticCore for type elastic

func NewServiceElasticCore

func NewServiceElasticCore(model interface{}, serverURL string) (*ElasticCore, error)

NewServiceElasticCore for new service elastic core

func (*ElasticCore) AddDocument

func (elasticCore *ElasticCore) AddDocument(ID string, bodyJSON interface{}) error

AddDocument for add document and indexing elastic

func (*ElasticCore) DeleteDocument

func (elasticCore *ElasticCore) DeleteDocument(ID string) error

DeleteDocument for delete th elastic search

func (*ElasticCore) DeleteIndex

func (elasticCore *ElasticCore) DeleteIndex() error

DeleteIndex for delete th elastic search

func (*ElasticCore) EditDocument

func (elasticCore *ElasticCore) EditDocument(ID string, bodyJSON interface{}) error

EditDocument for add document and indexing elastic

func (*ElasticCore) MultipleinsertDocumentByStruct

func (elasticCore *ElasticCore) MultipleinsertDocumentByStruct(IDParams string, str interface{}) error

MultipleinsertDocumentByStruct for struct inheretence

type ElasticCoreInter

type ElasticCoreInter interface{}

ElasticCoreInter for interfacing function elastic

type RAbbitMQCoreInter

type RAbbitMQCoreInter interface{}

RAbbitMQCoreInter interfacing function rabbit MQ struct

type RabbitMQConfig

type RabbitMQConfig struct {
	Host       string `validate:"required"`
	Hostname   string `validate:"required"`
	Port       string `validate:"required"`
	User       string `validate:"required"`
	Password   string `validate:"required"`
	WorkerName string `validate:"required"`
}

RabbitMQConfig struct of rabbit mq

type RabbitMQCore

type RabbitMQCore struct {
	Config  *RabbitMQConfig
	Conn    *amqp.Connection
	Channel *amqp.Channel
	Queue   amqp.Queue
}

RabbitMQCore struct of rabbit MQ

func NewServiceRabbitMQ

func NewServiceRabbitMQ(config *RabbitMQConfig) (*RabbitMQCore, error)

NewServiceRabbitMQ for new service of rabbitMQ

func (*RabbitMQCore) RegisterNewTask

func (rb *RabbitMQCore) RegisterNewTask(body string) error

RegisterNewTask for register new task

func (*RabbitMQCore) RegisterWorker

func (rb *RabbitMQCore) RegisterWorker() (<-chan amqp.Delivery, error)

RegisterWorker function for declare queou

type RedisCore

type RedisCore struct {
	Conn *redis.Client
}

RedisCore struct for redis

func NewServiceRedisCore

func NewServiceRedisCore(host string, port string) (*RedisCore, error)

NewServiceRedisCore for New RedisCore instance

func (*RedisCore) CreateOrUpdateDocument

func (red *RedisCore) CreateOrUpdateDocument(name string, id string, params ...interface{}) error

CreateOrUpdateDocument func for insert or update redis

func (*RedisCore) DeleteDocument

func (red *RedisCore) DeleteDocument(name string, id string) error

DeleteDocument func for delete redis

func (*RedisCore) GetAllDocument

func (red *RedisCore) GetAllDocument(name string, id string) (map[string]string, error)

GetAllDocument for get all document return a new map

func (*RedisCore) GetDocument

func (red *RedisCore) GetDocument(name string, id string, field string) (string, error)

GetDocument for get document return as string

type RedisCoreInter

type RedisCoreInter interface {
	CreateOrUpdateDocument(name string, id string, params ...interface{}) error
	DeleteDocument(name string, id string) error
	GetDocument(name string, id string, field string) (string, error)
	GetAllDocument(name string, id string) (map[string]string, error)
}

RedisCoreInter for interfacing RedisCore

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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