初步实现对象存储源站

This commit is contained in:
GoEdgeLab
2023-06-07 17:26:34 +08:00
parent 0d25dd9de0
commit 2a8e703e70
11 changed files with 357 additions and 171 deletions

View File

@@ -1,5 +1,7 @@
package serverconfigs
import "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/ossconfigs"
type Protocol string
const (
@@ -52,7 +54,11 @@ func (this Protocol) IsUDPFamily() bool {
return this == ProtocolUDP
}
// 主协议
func (this Protocol) IsOSS() bool {
return ossconfigs.IsOSSProtocol(this.String())
}
// Primary 主协议
func (this Protocol) Primary() Protocol {
switch this {
case ProtocolHTTP, ProtocolHTTP4, ProtocolHTTP6:
@@ -72,7 +78,7 @@ func (this Protocol) Primary() Protocol {
}
}
// Scheme
// Scheme schema
func (this Protocol) Scheme() string {
return string(this)
}