components

package
v0.0.0-...-9ae062e Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	OPT_CONNTIMEOUT string = "OPT_CONNTIMEOUT"
	OPT_RWTIMEOUT          = "OPT_RWTIMEOUT"
)
View Source
const (
	OPT_DURABLE    string = "OPT_DURABLE"
	OPT_AUTODELETE        = "OPT_AUTODELETE"
	OPT_EXCLUSIVE         = "OPT_EXCLUSIVE"
	OPT_NOWAIT            = "OPT_NOWAIT"
	OPT_ARGS              = "OPT_ARGS"
	OPT_EXCHANGE          = "OPT_EXCHANGE"
	OPT_MANDATORY         = "OPT_MANDATORY"
	OPT_IMMEDIATE         = "OPT_IMMEDIATE"
	OPT_CONSUMER          = "OPT_CONSUMER"
	OPT_AUTOACK           = "OPT_AUTOACK"
	OPT_NOLOCAL           = "OPT_NOLOCAL"
)
View Source
const (
	OPT_MAXASYNC string = "OPT_MAXASYNC"
)
View Source
const (
	OPT_MAXPOOL string = "OPT_MAXPOOL"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CompOptions

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

func NewCompOptions

func NewCompOptions() *CompOptions

func (*CompOptions) Get

func (c *CompOptions) Get(key string) interface{}

func (*CompOptions) GetArgs

func (c *CompOptions) GetArgs(key string) map[string]interface{}

func (*CompOptions) GetBool

func (c *CompOptions) GetBool(key string) bool

func (*CompOptions) GetInt

func (c *CompOptions) GetInt(key string) int

func (*CompOptions) GetString

func (c *CompOptions) GetString(key string) string

func (*CompOptions) Set

func (c *CompOptions) Set(key string, val interface{})

type Email

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

func NewEmail

func NewEmail() *Email

func (*Email) Close

func (e *Email) Close()

func (*Email) Conn

func (e *Email) Conn(url string, host string) error

func (*Email) SendTo

func (e *Email) SendTo(to string, title string, content string) error

func (*Email) SetAuthor

func (e *Email) SetAuthor(user string, pass string)

func (*Email) SetOption

func (e *Email) SetOption(key string, val interface{})

type Etcd

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

func NewEtcd

func NewEtcd() *Etcd

func (*Etcd) BindSubscriber

func (e *Etcd) BindSubscriber(subscriber ISubscriber)

func (*Etcd) Client

func (e *Etcd) Client() *clientv3.Client

func (*Etcd) Close

func (e *Etcd) Close()

func (*Etcd) Conn

func (e *Etcd) Conn(urls string, root string) error

func (*Etcd) Delete

func (e *Etcd) Delete(path string) (int64, error)

func (*Etcd) Get

func (e *Etcd) Get(path string) (string, error)

func (*Etcd) Gets

func (e *Etcd) Gets(path string) (map[string]string, error)

func (*Etcd) Set

func (e *Etcd) Set(path string, val string) error

func (*Etcd) SetAuthor

func (e *Etcd) SetAuthor(user string, pass string)

func (*Etcd) SetOption

func (e *Etcd) SetOption(key string, val interface{})

func (*Etcd) Subscribe

func (e *Etcd) Subscribe(path string)

type IComponent

type IComponent interface {
	Conn(string, string) error
	Close()
	SetAuthor(string, string)
	SetOption(string, interface{})
}

func NewComponent

func NewComponent(url string) (IComponent, error)

type IPublisher

type IPublisher interface {
	Publish(string, string) error
}

type ISubscribable

type ISubscribable interface {
	Subscribe(string)
	BindSubscriber(ISubscriber)
}

the publish-subscrib equipment

type ISubscriber

type ISubscriber interface {
	OnSubscribe(string)
	OnSubMessage(string, string)
	OnSubError(string, error)
}

type MongoDB

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

func NewMongoDB

func NewMongoDB() *MongoDB

func (*MongoDB) BindSubscriber

func (m *MongoDB) BindSubscriber(subscriber ISubscriber)

func (*MongoDB) Close

func (m *MongoDB) Close()

func (*MongoDB) Collect

func (m *MongoDB) Collect(colName string) *mongo.Collection

func (*MongoDB) Conn

func (m *MongoDB) Conn(url string, dbname string) error

func (*MongoDB) NewObjectId

func (m *MongoDB) NewObjectId() primitive.ObjectID

func (*MongoDB) RawDB

func (m *MongoDB) RawDB() *mongo.Database

func (*MongoDB) SetAuthor

func (m *MongoDB) SetAuthor(user string, pass string)

func (*MongoDB) SetOption

func (m *MongoDB) SetOption(key string, val interface{})

func (*MongoDB) Subscribe

func (m *MongoDB) Subscribe(colName string) error

type MySql

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

func NewMySql

func NewMySql() *MySql

func (*MySql) Close

func (m *MySql) Close()

func (*MySql) Conn

func (m *MySql) Conn(url string, dbname string) error

func (*MySql) RawDB

func (m *MySql) RawDB() *sql.DB

func (*MySql) SetAuthor

func (m *MySql) SetAuthor(user string, pass string)

func (*MySql) SetOption

func (m *MySql) SetOption(key string, val interface{})

func (*MySql) Table

func (m *MySql) Table(tab string) *SqlBuilder

type RabbitMQ

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

func NewRabbitMQ

func NewRabbitMQ() *RabbitMQ

func (*RabbitMQ) BindSubscriber

func (r *RabbitMQ) BindSubscriber(subscriber ISubscriber)

func (*RabbitMQ) Close

func (r *RabbitMQ) Close()

func (*RabbitMQ) Conn

func (r *RabbitMQ) Conn(url string, host string) error

func (*RabbitMQ) Publish

func (r *RabbitMQ) Publish(que string, msg string) error

func (*RabbitMQ) SetAuthor

func (r *RabbitMQ) SetAuthor(user string, pass string)

func (*RabbitMQ) SetOption

func (r *RabbitMQ) SetOption(key string, val interface{})

func (*RabbitMQ) Subscribe

func (r *RabbitMQ) Subscribe(que string)

type Redis

type Redis struct {
	RedisClient *red.Pool
	// contains filtered or unexported fields
}

func NewRedis

func NewRedis() *Redis

func (*Redis) BindSubscriber

func (r *Redis) BindSubscriber(subscriber ISubscriber)

func (*Redis) Close

func (r *Redis) Close()

func (*Redis) Conn

func (r *Redis) Conn(url string, db string) error

func (*Redis) Delete

func (r *Redis) Delete(key string) (int64, error)

func (*Redis) Exists

func (r *Redis) Exists(key string) (bool, error)

func (*Redis) Get

func (r *Redis) Get(key string) (string, error)

func (*Redis) GetClient

func (r *Redis) GetClient() *RedisClient

func (*Redis) HDel

func (r *Redis) HDel(key string, hkey string) (bool, error)

func (*Redis) HExists

func (r *Redis) HExists(key string, hkey string) (bool, error)

func (*Redis) HGet

func (r *Redis) HGet(key string, hkey string) (string, error)

func (*Redis) HGetAll

func (r *Redis) HGetAll(key string) (map[string]string, error)

func (*Redis) HKeys

func (r *Redis) HKeys(key string) ([]string, error)

func (*Redis) HLen

func (r *Redis) HLen(key string) (int, error)

func (*Redis) HMSet

func (r *Redis) HMSet(key string, dict map[string]string) (bool, error)

func (*Redis) HSet

func (r *Redis) HSet(key string, hkey string, val string) (bool, error)

func (*Redis) HSetNx

func (r *Redis) HSetNx(key string, hkey string, val string) (bool, error)

func (*Redis) KVals

func (r *Redis) KVals(key string) ([]string, error)

func (*Redis) Publish

func (r *Redis) Publish(channel string, msg string) error

func (*Redis) SAdd

func (r *Redis) SAdd(key string, member string) (bool, error)

func (*Redis) SMembers

func (r *Redis) SMembers(key string) ([]string, error)

func (*Redis) SRem

func (r *Redis) SRem(key string, member string) (int64, error)

func (*Redis) Set

func (r *Redis) Set(key string, val string) (bool, error)

func (*Redis) SetAuthor

func (r *Redis) SetAuthor(user string, pass string)

func (*Redis) SetOption

func (r *Redis) SetOption(key string, val interface{})

func (*Redis) Subscribe

func (r *Redis) Subscribe(channel string)

func (*Redis) ZAdd

func (r *Redis) ZAdd(key string, score float32, val string) (bool, error)

func (*Redis) ZCount

func (r *Redis) ZCount(key string, start float32, end float32) (int, error)

func (*Redis) ZRange

func (r *Redis) ZRange(key string, start float32, end float32) ([]string, error)

func (*Redis) ZSize

func (r *Redis) ZSize(key string) (int, error)

type RedisClient

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

func NewRedisClient

func NewRedisClient(conn red.Conn) *RedisClient

func (*RedisClient) Delete

func (rc *RedisClient) Delete(key string) (int64, error)

func (*RedisClient) Dispose

func (rc *RedisClient) Dispose()

func (*RedisClient) Exists

func (rc *RedisClient) Exists(key string) (bool, error)

func (*RedisClient) Get

func (rc *RedisClient) Get(key string) (string, error)

func (*RedisClient) HDel

func (rc *RedisClient) HDel(key string, hkey string) (bool, error)

func (*RedisClient) HExists

func (rc *RedisClient) HExists(key string, hkey string) (bool, error)

func (*RedisClient) HGet

func (rc *RedisClient) HGet(key string, hkey string) (string, error)

func (*RedisClient) HGetAll

func (rc *RedisClient) HGetAll(key string) (map[string]string, error)

func (*RedisClient) HKeys

func (rc *RedisClient) HKeys(key string) ([]string, error)

func (*RedisClient) HLen

func (rc *RedisClient) HLen(key string) (int, error)

func (*RedisClient) HMSet

func (rc *RedisClient) HMSet(key string, dict map[string]string) (bool, error)

func (*RedisClient) HSet

func (rc *RedisClient) HSet(key string, hkey string, val string) (bool, error)

func (*RedisClient) HSetNx

func (rc *RedisClient) HSetNx(key string, hkey string, val string) (bool, error)

func (*RedisClient) KVals

func (rc *RedisClient) KVals(key string) ([]string, error)

func (*RedisClient) SAdd

func (rc *RedisClient) SAdd(key string, member string) (bool, error)

func (*RedisClient) SMembers

func (rc *RedisClient) SMembers(key string) ([]string, error)

func (*RedisClient) SRem

func (rc *RedisClient) SRem(key string, member string) (int64, error)

func (*RedisClient) Set

func (rc *RedisClient) Set(key string, val string) (bool, error)

func (*RedisClient) ZAdd

func (rc *RedisClient) ZAdd(key string, score float32, val string) (bool, error)

func (*RedisClient) ZCount

func (rc *RedisClient) ZCount(key string, start float32, end float32) (int, error)

func (*RedisClient) ZRange

func (rc *RedisClient) ZRange(key string, start float32, end float32) ([]string, error)

func (*RedisClient) ZSize

func (rc *RedisClient) ZSize(key string) (int, error)

type SqlBuilder

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

func (*SqlBuilder) And

func (s *SqlBuilder) And(field string, compare string, val string) *SqlBuilder

func (*SqlBuilder) AsyncExec

func (s *SqlBuilder) AsyncExec() error

func (*SqlBuilder) Delete

func (s *SqlBuilder) Delete() *SqlBuilder

func (*SqlBuilder) Etc

func (s *SqlBuilder) Etc(etc string) *SqlBuilder

func (*SqlBuilder) Exec

func (s *SqlBuilder) Exec() (sql.Result, error)

func (*SqlBuilder) Insert

func (s *SqlBuilder) Insert(val map[string]string) *SqlBuilder

func (*SqlBuilder) Or

func (s *SqlBuilder) Or(field string, compare string, val string) *SqlBuilder

func (*SqlBuilder) Query

func (s *SqlBuilder) Query() (*sql.Rows, error)

func (*SqlBuilder) Select

func (s *SqlBuilder) Select(sel string) *SqlBuilder

func (*SqlBuilder) Update

func (s *SqlBuilder) Update(val map[string]string) *SqlBuilder

func (*SqlBuilder) Where

func (s *SqlBuilder) Where(field string, compare string, val string) *SqlBuilder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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