feat: complete cmpp platform phases 0-5

This commit is contained in:
hectorzhao
2026-07-01 13:22:04 +08:00
parent 824a8b334f
commit ee926fea04
86 changed files with 10490 additions and 14 deletions
+41
View File
@@ -0,0 +1,41 @@
package cmppadapter
import (
"time"
cmpp "github.com/bigwhite/gocmpp"
)
type Version string
const (
Version20 Version = "2.0"
Version30 Version = "3.0"
)
type ClientConfig struct {
Version Version
Address string
User string
Password string
Timeout time.Duration
}
type Client struct {
raw *cmpp.Client
}
func NewClient(config ClientConfig) *Client {
return &Client{raw: cmpp.NewClient(toProtocolType(config.Version))}
}
func (c *Client) Raw() *cmpp.Client {
return c.raw
}
func toProtocolType(version Version) cmpp.Type {
if version == Version20 {
return cmpp.V20
}
return cmpp.V30
}