connector

package
v0.0.0-...-4d43d38 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2017 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AMQP   = "AMQP"
	GET    = "GET"
	POST   = "POST"
	PUT    = "PUT"
	DELETE = "DELETE"
	HEAD   = "HEAD"
	OPTION = "OPTION"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsulService

type ConsulService interface {
	Config() *NbConfig
	Services() (map[string]*consul.AgentService, error)
	DeRegister()
	CreateDataTable(bean ...interface{}) error
	InsertRecord(bean ...interface{}) (int64, error)
	UpdateRecord(bean interface{}, conditions ...interface{}) (int64, error)
	DeleteRecord(bean interface{}) (int64, error)
	FindRecords(bean interface{}, query interface{}, args ...interface{}) error
	GetFirstRecord(bean interface{}) (bool, error)
	RegisterMessageHandler(api string, callback func([]byte) ([]byte, error)) error
	RegisterHttpHandler(api string, method string, callback func([]byte) ([]byte, error))
	StartServer(remoteShutdown bool) error
	SendRequest(method string, service string, api string, param string) error
}

func CreateService

func CreateService(filepath string) (ConsulService, error)

type NbAgentInfo

type NbAgentInfo struct {
	Autoregister bool   `default:"false"`
	Server       string `required:"true"`
	Port         uint32 `required:"true"`
	Name         string `required:"true"`
	Id           string `required:"true"`
	Username     string
	Password     string
	Tags         []string
}

type NbCheckInfo

type NbCheckInfo struct {
	Method   string
	Interval string
	Timeout  string
}

type NbConfig

type NbConfig struct {
	Service     NbAgentInfo
	Database    NbServerInfo
	Health      NbCheckInfo
	Amqp        NbServerInfo
	Application map[string]string
}

type NbLogger

type NbLogger struct {
	Destination string
}

type NbServerInfo

type NbServerInfo struct {
	Address  string
	Port     uint32
	Name     string
	Username string `default:"guest"`
	Password string `default:"guest"`
}

type RequestHistory

type RequestHistory struct {
	Id          int64     `xorm:"pk autoincr"`
	Ip          string    `xorm:"notnull default('')"`
	Service     string    `xorm:"notnull"`
	Api         string    `xorm:"notnull"`
	Param       string    `xorm:"notnull varchar(1024) default('')"`
	Result      string    `xorm:"notnull varchar(1024) default('')"`
	Method      string    `xorm:"notnull"`
	Direction   string    `xorm:"notnull"`
	RequestTime time.Time `xorm:"notnull created"`
	Version     int       `xorm:"notnull version"`
}

Jump to

Keyboard shortcuts

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