update
This commit is contained in:
parent
02b692c372
commit
7d9181c26a
3 changed files with 60 additions and 0 deletions
2
go.mod
2
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
|
||||
|
|
|
|||
2
go.sum
Normal file
2
go.sum
Normal file
|
|
@ -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=
|
||||
56
zgate.go
Normal file
56
zgate.go
Normal file
|
|
@ -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
|
||||
Loading…
Reference in a new issue