Documentation
¶
Index ¶
- type APIs
- type AuditContext
- func (ctx *AuditContext) BindRequestData(body interface{}) error
- func (ctx *AuditContext) BindResponseData(body interface{}) error
- func (ctx *AuditContext) CreateAudit(audit *apistructs.Audit) error
- func (ctx *AuditContext) GetApp(idObject interface{}) (*apistructs.ApplicationDTO, error)
- func (ctx *AuditContext) GetOrg(idObject interface{}) (*apistructs.OrgDTO, error)
- func (ctx *AuditContext) GetParamInt64(key string) (int64, error)
- func (ctx *AuditContext) GetParamString(key string) (string, error)
- func (ctx *AuditContext) GetParamUInt64(key string) (uint64, error)
- func (ctx *AuditContext) GetProject(idObject interface{}) (*apistructs.ProjectDTO, error)
- type Matcher
- type Path
- type Scheme
- type Spec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditContext ¶
type AuditContext struct {
UrlParams map[string]string
UserID string
OrgID int64
Request *http.Request
Response *http.Response
Bundle *bundle.Bundle
BeginTime time.Time
EndTime time.Time
Result apistructs.Result
ClientIP string
UserAgent string
Cache *sync.Map
}
func (*AuditContext) BindRequestData ¶
func (ctx *AuditContext) BindRequestData(body interface{}) error
func (*AuditContext) BindResponseData ¶
func (ctx *AuditContext) BindResponseData(body interface{}) error
func (*AuditContext) CreateAudit ¶
func (ctx *AuditContext) CreateAudit(audit *apistructs.Audit) error
CreateAudit 创建审计事件
func (*AuditContext) GetApp ¶
func (ctx *AuditContext) GetApp(idObject interface{}) (*apistructs.ApplicationDTO, error)
func (*AuditContext) GetOrg ¶
func (ctx *AuditContext) GetOrg(idObject interface{}) (*apistructs.OrgDTO, error)
func (*AuditContext) GetParamInt64 ¶
func (ctx *AuditContext) GetParamInt64(key string) (int64, error)
func (*AuditContext) GetParamString ¶
func (ctx *AuditContext) GetParamString(key string) (string, error)
func (*AuditContext) GetParamUInt64 ¶
func (ctx *AuditContext) GetParamUInt64(key string) (uint64, error)
func (*AuditContext) GetProject ¶
func (ctx *AuditContext) GetProject(idObject interface{}) (*apistructs.ProjectDTO, error)
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
func NewMatcher ¶
func (*Matcher) MatchBackendPath ¶
func (*Matcher) MatchMethod ¶
type Spec ¶
type Spec struct {
Path *Path
BackendPath *Path
Host string
Scheme Scheme
Method string
Custom func(rw http.ResponseWriter, req *http.Request)
CustomResponse func(*http.Response) error
Audit func(*AuditContext) error
NeedDesensitize bool // 是否需要对返回的 userinfo 进行脱敏处理,id也会被脱敏
CheckLogin bool
TryCheckLogin bool // 和CheckLogin区别为如果不登录也会通过,只是没有user-id
CheckToken bool
CheckBasicAuth bool
ChunkAPI bool
// `Host` 是API原始配置
// 分别转化为 marathon 和 k8s 的host
MarathonHost string
K8SHost string
Port int
}
Click to show internal directories.
Click to hide internal directories.