Documentation ¶
Overview ¶
Package site is a generated protocol buffer package.
It is generated from these files:
site.proto
It has these top-level messages:
ConfigRequest ConfigResponse
Index ¶
- func AcceptSiteServiceClient(lis net.Listener, x SiteService)
- func CheckSign(sign_str, data, salt string) bool
- func GetBalanceType(site_id, dbname, url ...string) (*[]SiteBalanceType, error)
- func ListenAndServeSiteService(network, addr string, x SiteService) error
- func NewSiteServiceServer(x SiteService) *rpc.Server
- func RegisterSiteService(srv *rpc.Server, x SiteService) error
- func Sign(data string, salt string) string
- type ConfigRequest
- type ConfigResponse
- type SiteBalanceType
- type SiteBalanceTypeReqArg
- type SiteConfigItemReqArg
- type SiteConfigItemRes
- type SiteService
- type SiteServiceClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcceptSiteServiceClient ¶
func AcceptSiteServiceClient(lis net.Listener, x SiteService)
AcceptSiteServiceClient accepts connections on the listener and serves requests for each incoming connection. Accept blocks; the caller typically invokes it in a go statement.
func GetBalanceType ¶ added in v0.8.0
func GetBalanceType(site_id, dbname, url ...string) (*[]SiteBalanceType, error)
*
- 由配置key取对应value
- 请求及回均加密验签
- 2021/01/20
- GZ
func ListenAndServeSiteService ¶
func ListenAndServeSiteService(network, addr string, x SiteService) error
ListenAndServeSiteService listen announces on the local network address laddr and serves the given SiteService implementation.
func NewSiteServiceServer ¶
func NewSiteServiceServer(x SiteService) *rpc.Server
NewSiteServiceServer returns a new SiteService Server.
func RegisterSiteService ¶
func RegisterSiteService(srv *rpc.Server, x SiteService) error
RegisterSiteService publish the given SiteService implementation on the server.
Types ¶
type ConfigRequest ¶
type ConfigRequest struct { Data *string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` Time *string `protobuf:"bytes,2,opt,name=time" json:"time,omitempty"` Sign *string `protobuf:"bytes,3,opt,name=sign" json:"sign,omitempty"` XXX_unrecognized []byte `json:"-"` }
配置信息请求结构
func (*ConfigRequest) GetData ¶
func (m *ConfigRequest) GetData() string
func (*ConfigRequest) GetSign ¶
func (m *ConfigRequest) GetSign() string
func (*ConfigRequest) GetTime ¶
func (m *ConfigRequest) GetTime() string
func (*ConfigRequest) ProtoMessage ¶
func (*ConfigRequest) ProtoMessage()
func (*ConfigRequest) Reset ¶
func (m *ConfigRequest) Reset()
func (*ConfigRequest) String ¶
func (m *ConfigRequest) String() string
type ConfigResponse ¶
type ConfigResponse struct { Data *string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` Time *string `protobuf:"bytes,2,opt,name=time" json:"time,omitempty"` Sign *string `protobuf:"bytes,3,opt,name=sign" json:"sign,omitempty"` XXX_unrecognized []byte `json:"-"` }
配置信息响应结构
func (*ConfigResponse) GetData ¶
func (m *ConfigResponse) GetData() string
func (*ConfigResponse) GetSign ¶
func (m *ConfigResponse) GetSign() string
func (*ConfigResponse) GetTime ¶
func (m *ConfigResponse) GetTime() string
func (*ConfigResponse) ProtoMessage ¶
func (*ConfigResponse) ProtoMessage()
func (*ConfigResponse) Reset ¶
func (m *ConfigResponse) Reset()
func (*ConfigResponse) String ¶
func (m *ConfigResponse) String() string
type SiteBalanceType ¶ added in v0.8.0
type SiteBalanceTypeReqArg ¶ added in v0.8.0
type SiteConfigItemReqArg ¶
type SiteConfigItemRes ¶
func GetConfigItem ¶
func GetConfigItem(site_id, dbname, key string, url ...string) (*SiteConfigItemRes, error)
*
- 由配置key取对应value
- 请求及回均加密验签
- 2021/01/20
- GZ
type SiteService ¶
type SiteService interface { GetConfig(in *ConfigRequest, out *ConfigResponse) error GetBalanceType(in *ConfigRequest, out *ConfigResponse) error }
type SiteServiceClient ¶
func DialSiteService ¶
func DialSiteService(network, addr string) (*SiteServiceClient, *rpc.Client, error)
DialSiteService connects to an SiteService at the specified network address.
func DialSiteServiceTimeout ¶
func DialSiteServiceTimeout(network, addr string, timeout time.Duration) (*SiteServiceClient, *rpc.Client, error)
DialSiteServiceTimeout connects to an SiteService at the specified network address.
func NewSiteServiceClient ¶
func NewSiteServiceClient(conn io.ReadWriteCloser) (*SiteServiceClient, *rpc.Client)
NewSiteServiceClient returns a SiteService rpc.Client and stub to handle requests to the set of SiteService at the other end of the connection.
func (*SiteServiceClient) GetBalanceType ¶ added in v0.8.0
func (c *SiteServiceClient) GetBalanceType(in *ConfigRequest, out *ConfigResponse) error
func (*SiteServiceClient) GetConfig ¶
func (c *SiteServiceClient) GetConfig(in *ConfigRequest, out *ConfigResponse) error