site

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

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

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 CheckSign

func CheckSign(sign_str, data, salt string) bool

*

  • 验证签名

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.

func Sign

func Sign(data string, salt string) string

*

  • 签名

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 SiteBalanceType struct {
	Id        string
	Name      string
	UseLimit  string
	Unit      string
	Type      string
	CleanRate string
	CleanTime string
}

type SiteBalanceTypeReqArg added in v0.8.0

type SiteBalanceTypeReqArg struct {
	SiteId string `json:"site_id"`
	Dbname string `json:"dbname"`
}

type SiteConfigItemReqArg

type SiteConfigItemReqArg struct {
	SiteId string `json:"site_id"`
	Dbname string `json:"dbname"`
	Key    string `json:"key"`
}

type SiteConfigItemRes

type SiteConfigItemRes struct {
	Type  string
	Value string
}

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

type SiteServiceClient struct {
	*rpc.Client
}

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

Jump to

Keyboard shortcuts

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