Documentation ¶
Overview ¶
* *Open source agreement: * The project is based on the GPLv3 protocol. *
Index ¶
- Constants
- Variables
- func ChanClean(c chan []byte)
- func ChanClose(c interface{})
- func CheckError_test(inerr error, t *testing.T)
- func CheckError_test_noExit(inerr error, t *testing.T)
- func Find0(v1 []byte) (int, bool)
- func GetGSPackSize(data []byte) uint16
- func GetIP(conn net.Addr) string
- func GetNetConnAddrString(str string, conn net.Conn) string
- func GetNetLocalRDPort() string
- func GetRDKeyString96() string
- func GetRDNetConn() (net.Conn, net.Conn)
- func GetRDNetConnLiten() (net.Conn, net.Conn, net.Listener)
- func IsClosedPanic(conn net.Conn)
- func IsErrorNetUsually(err error) bool
- func IsNetConnClosed(conn net.Conn) bool
- func IsNetConnClosed_Read(conn net.Conn) bool
- func IsOk_PackDataLen_panic(data []byte)
- func NetConnWriteAll(dst net.Conn, buf []byte) (int64, error)
- func NewGSRSAPackNetImp(key string, serverRSAKey, clientRSAKey *gsrsa.RSA) *gsRSAPackNetImp
- func NewRSAPackImpWithGSTClient(key string, serverRSAKey, ClientRSAKey *gsrsa.RSA) *gsRSAPackImp
- func NewRSAPackImpWithGSTServer(key string, serverRSAKey *gsrsa.RSA) *gsRSAPackImp
- func Nullprint(v ...interface{}) (int, error)
- func Nullprintf(format string, a ...interface{}) (n int, err error)
- func Panic_Recover_GSCtx(inlog *log.Logger, gctx IGSContext)
- func RunGRuntimeStatistics_print(inlog *log.Logger, inruntstats IRuntime_statistics)
- func TcpDoKeepAlive(conn net.Conn)
- type Conn
- type GSTNetConnDebug
- func (c *GSTNetConnDebug) Close() error
- func (c *GSTNetConnDebug) LocalAddr() net.Addr
- func (c *GSTNetConnDebug) Read(b []byte) (n int, err error)
- func (c *GSTNetConnDebug) RemoteAddr() net.Addr
- func (c *GSTNetConnDebug) SetDeadline(t time.Time) error
- func (c *GSTNetConnDebug) SetReadDeadline(t time.Time) error
- func (c *GSTNetConnDebug) SetWriteDeadline(t time.Time) error
- func (c *GSTNetConnDebug) Write(b []byte) (n int, err error)
- type GsConfig
- type IGId
- type IGSContext
- type IGSPack
- type IGSPackNet
- type IGSRSAPackNet
- type IGlobal_values
- type IGorou_status
- type IGsRSAPack
- type IGsStatus
- type INetTime
- type IRunTimeDebugInfo
- type IRuntime_statistics
- type IStatusConnList
- type UnpackReV
- func (u *UnpackReV) IsChangeCryKey() bool
- func (u *UnpackReV) IsChangeCryKeyFromGSTClient() bool
- func (u *UnpackReV) IsChangeCryKeyFromGSTServer() bool
- func (u *UnpackReV) IsClientPubKey() bool
- func (u *UnpackReV) IsPOGen() bool
- func (u *UnpackReV) IsPOHello() bool
- func (u *UnpackReV) IsPOVersion() bool
Constants ¶
View Source
const G_Deep_debug = gsbase.G_Deep_debug
View Source
const G_Info_protobuf bool = true
View Source
const G_RunTime_Debug = gsbase.G_RunTime_Debug
View Source
const G_Version string = gsbase.G_Version
Variables ¶
View Source
var G_logger *log.Logger
Functions ¶
func CheckError_test ¶ added in v6.3.0
func CheckError_test_old(inerr error, t *testing.T) { if inerr != nil { _, file, line, ok := runtime.Caller(1) if !ok { file = "???" line = -1 } finfo, _ := os.Stat(file) fileName := finfo.Name() t.Logf("%s:%d: ", fileName, line) panic(inerr) //t.Fatal(inerr) } }
func CheckError_test_noExit_old(inerr error, t *testing.T) { if inerr != nil { _, file, line, ok := runtime.Caller(1) if !ok { file = "???" line = -1 } finfo, _ := os.Stat(file) fileName := finfo.Name() errstr := fmt.Sprintf("%s:%d:Test error: %s", fileName, line, inerr) t.Logf(errstr) log.Println(errstr) } }
func CheckError_test_noExit ¶ added in v6.3.0
func GetGSPackSize ¶ added in v6.3.0
func GetNetConnAddrString ¶ added in v6.3.0
func GetNetLocalRDPort ¶ added in v6.3.0
func GetNetLocalRDPort() string
func GetRDKeyString96 ¶ added in v6.3.0
func GetRDKeyString96() string
func GetRDKeyString32() string { return gsrand.GetrandStringPlus(32) }
func GetRDNetConnLiten ¶ added in v6.3.0
func IsClosedPanic ¶ added in v6.3.0
func IsErrorNetUsually ¶ added in v6.3.0
func IsNetConnClosed ¶ added in v6.3.0
func IsNetConnClosed_Read ¶ added in v6.3.0
func IsOk_PackDataLen_panic ¶ added in v6.3.0
func IsOk_PackDataLen_panic(data []byte)
func NetConnWriteAll ¶ added in v6.3.0
func NewGSRSAPackNetImp ¶ added in v6.3.0
func NewRSAPackImpWithGSTClient ¶ added in v6.3.0
func NewRSAPackImpWithGSTServer ¶ added in v6.3.0
func Nullprintf ¶
func Panic_Recover_GSCtx ¶ added in v6.3.0
func Panic_Recover_GSCtx(inlog *log.Logger, gctx IGSContext)
func RunGRuntimeStatistics_print ¶
func RunGRuntimeStatistics_print(inlog *log.Logger, inruntstats IRuntime_statistics)
func TcpDoKeepAlive ¶ added in v6.3.0
Types ¶
type GSTNetConnDebug ¶ added in v6.3.0
type GSTNetConnDebug struct {
// contains filtered or unexported fields
}
func NewGSTNetConnDebug ¶ added in v6.3.0
func NewGSTNetConnDebug(conn net.Conn) *GSTNetConnDebug
func (*GSTNetConnDebug) Close ¶ added in v6.3.0
func (c *GSTNetConnDebug) Close() error
func (*GSTNetConnDebug) LocalAddr ¶ added in v6.3.0
func (c *GSTNetConnDebug) LocalAddr() net.Addr
func (*GSTNetConnDebug) Read ¶ added in v6.3.0
func (c *GSTNetConnDebug) Read(b []byte) (n int, err error)
func (*GSTNetConnDebug) RemoteAddr ¶ added in v6.3.0
func (c *GSTNetConnDebug) RemoteAddr() net.Addr
func (*GSTNetConnDebug) SetDeadline ¶ added in v6.3.0
func (c *GSTNetConnDebug) SetDeadline(t time.Time) error
func (*GSTNetConnDebug) SetReadDeadline ¶ added in v6.3.0
func (c *GSTNetConnDebug) SetReadDeadline(t time.Time) error
func (*GSTNetConnDebug) SetWriteDeadline ¶ added in v6.3.0
func (c *GSTNetConnDebug) SetWriteDeadline(t time.Time) error
type GsConfig ¶
type GsConfig struct { Listen string Servers []string Key string RSAServerPrivate string RSAServerPublic string Tmr_display_time int Tmr_changekey_time int NetworkTimeout int Debug bool Mt_model bool WebUI bool }
func CreateGsconfig ¶
func (*GsConfig) GetRSAServer ¶ added in v6.3.0
Deep copy, new obj.
func (*GsConfig) GetRSAServerPrivate ¶ added in v6.3.0
func (c *GsConfig) GetRSAServerPrivate() *rsa.PrivateKey
func (*GsConfig) GetRSAServerPublic ¶ added in v6.3.0
func (*GsConfig) GetServer_rand ¶
func (*GsConfig) GetServers ¶
type IGSContext ¶ added in v6.3.0
func NewGSContextImp ¶ added in v6.3.0
func NewGSContextImp(gsid uint64, gsst IGsStatus) IGSContext
type IGSPack ¶ added in v6.3.0
type IGSPackNet ¶ added in v6.3.0
type IGSPackNet interface { IGSPack WriteEncryData([]byte) error GetDecryData() ([]byte, error) GetDecryDataFormBytes([]byte) ([]byte, error) GetGSPackSize(data []byte) uint16 }
net buffer encrypter decrypter pack unpack
func NewGsPackNet ¶ added in v6.3.0
func NewGsPackNet(key string) IGSPackNet
type IGSRSAPackNet ¶ added in v6.3.0
type IGSRSAPackNet interface { IGSPackNet ClientPublicKeyPack() []byte ChangeCryKeyFromGSTServer() ([]byte, string) ChangeCryKeyFromGSTClient() ([]byte, string) PackPOHello() []byte IsExistsClientKey() bool GetClientRSAKey() *gsrsa.RSA SetClientRSAKey(*gsrsa.RSA) GetServerRSAKey() *gsrsa.RSA UnpackEx([]byte) (*UnpackReV, error) UnpackOneGSTPackFromNetConn(src net.Conn, timeout time.Duration) (*UnpackReV, error) }
func NewGSRSAPackNetImpWithGSTClient ¶ added in v6.3.0
func NewGSRSAPackNetImpWithGSTClient(key string, serverRSAKey, clientRSAKey *gsrsa.RSA) IGSRSAPackNet
func NewGSRSAPackNetImpWithGSTServer ¶ added in v6.3.0
func NewGSRSAPackNetImpWithGSTServer(key string, serverRSAKey *gsrsa.RSA) IGSRSAPackNet
type IGlobal_values ¶ added in v6.3.0
func NewGlobalValuesImp ¶ added in v6.3.0
func NewGlobalValuesImp() IGlobal_values
type IGorou_status ¶ added in v6.3.0
type IGorou_status interface { IsOk() bool SetOk() SetClose() }
func NewGorouStatus ¶ added in v6.3.0
func NewGorouStatus() IGorou_status
func NewGorouStatusNetConn ¶ added in v6.3.0
func NewGorouStatusNetConn(inconnList []net.Conn) IGorou_status
type IGsRSAPack ¶ added in v6.3.0
type IGsRSAPack interface { IGSPack ClientPublicKeyPack() []byte ChangeCryKeyFromGSTServer() ([]byte, string) ChangeCryKeyFromGSTClient() ([]byte, string) PackPOHello() []byte IsExistsClientKey() bool GetClientRSAKey() *gsrsa.RSA SetClientRSAKey(*gsrsa.RSA) GetServerRSAKey() *gsrsa.RSA UnpackEx([]byte) (*UnpackReV, error) }
type IGsStatus ¶ added in v6.3.0
type IGsStatus interface { GetJson() []byte GetStatusData() *gsStatusData GetStatusConnList() IStatusConnList }
func NewGsStatusImp ¶ added in v6.3.0
func NewGsStatusImp() IGsStatus
type INetTime ¶ added in v6.3.0
func NewNetTimeImp ¶ added in v6.3.0
func NewNetTimeImp() INetTime
func NewNetTimeImpName ¶ added in v6.3.0
type IRunTimeDebugInfo ¶ added in v6.3.0
var G_RunTimeDebugInfo1 IRunTimeDebugInfo
func NewRunTimeDebugInfo ¶ added in v6.3.0
func NewRunTimeDebugInfo() IRunTimeDebugInfo
type IRuntime_statistics ¶ added in v6.3.0
type IRuntime_statistics interface { // AddTotalNetworkData(int) AddSrcTotalNetData_recv(int) AddSrcTotalNetData_send(int) AddServerTotalNetData_recv(int) AddServerTotalNetData_send(int) GetJson() ([]byte, error) }
func NewRuntimeStatistics ¶
func NewRuntimeStatistics() IRuntime_statistics
func NewRuntimeStatisticsNULL ¶ added in v6.3.0
func NewRuntimeStatisticsNULL() IRuntime_statistics
type IStatusConnList ¶ added in v6.3.0
type UnpackReV ¶ added in v6.3.0
type UnpackReV struct { OperType uint32 ClientKey *gsrsa.RSA GenData []byte Version string Key []byte }
func (*UnpackReV) IsChangeCryKey ¶ added in v6.3.0
func (*UnpackReV) IsChangeCryKeyFromGSTClient ¶ added in v6.3.0
func (*UnpackReV) IsChangeCryKeyFromGSTServer ¶ added in v6.3.0
func (*UnpackReV) IsClientPubKey ¶ added in v6.3.0
func (*UnpackReV) IsPOVersion ¶ added in v6.3.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.