初步实现对象存储源站

This commit is contained in:
刘祥超
2023-06-07 17:26:34 +08:00
parent 555673b87d
commit b08064c1de
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)
}