diff --git a/go.mod b/go.mod index b3db296..b80c0f5 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,5 @@ module github.com/zeevdiukman/go-zgate go 1.24.0 + +require github.com/zeevdiukman/go-server v0.0.0-20250305093228-f3ab0096fcba diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..9cc2c65 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/zeevdiukman/go-server v0.0.0-20250305093228-f3ab0096fcba h1:BHG0fbASaIBXr+JyIaIt+/x1MIH+wAB5MTj2VQ1nlnU= +github.com/zeevdiukman/go-server v0.0.0-20250305093228-f3ab0096fcba/go.mod h1:HQARDR3c1btC+vNSDekVtC1KM/tVFrJqr3yGrPN3pbo= diff --git a/zgate.go b/zgate.go new file mode 100644 index 0000000..1ce1aea --- /dev/null +++ b/zgate.go @@ -0,0 +1,56 @@ +package zgate + +import ( + "github.com/zeevdiukman/go-server" +) + +type Zgate struct { + EntryPoints map[string]*EntryPoint + // TLS *TLS +} + +type EntryPoint struct { + Name string + // Port int + // _IP net.IP + *server.Server + isTLS bool +} + +// type TLS struct { +// CertPath string +// CertFile string +// KeyFile string +// } + +func NewGate() *Zgate { + return &Zgate{ + EntryPoints: make(map[string]*EntryPoint), + } +} + +func (z *Zgate) NewEntryPoint(entryPointName string) *EntryPoint { + e := newEntryPoint(z, entryPointName) + e.Server = server.New() + return e +} + +// func (e *EntryPoint) IP(ipAddress string) *EntryPoint { +// if ipAddress == "" { +// ipAddress = "127.0.0.1" +// } +// e._IP = net.ParseIP(ipAddress) +// return e +// } + +func newEntryPoint(z *Zgate, entryPointName string) *EntryPoint { + e := &EntryPoint{} + z.EntryPoints[entryPointName] = e + return e +} + +// func (z *EntryPoint) initServer() *EntryPoint{ +// server.New() +// return z.isTLS +// } +// func