Documentation ¶
Index ¶
- Variables
- func ApiBaseURL(host, tenantId string) string
- func NotFound(ctx *gin.Context)
- func ReadForm(ctx *gin.Context) ([]byte, error)
- func UnAuthorized(ctx *gin.Context)
- func WriteBinary(c *gin.Context, data []byte)
- func WriteErr(c *gin.Context, err error)
- func WriteErrString(c *gin.Context, msg string)
- func WriteFile(file string, data []byte, ctx *gin.Context)
- func WriteFinal(c *gin.Context, err error)
- func WriteJSON(c *gin.Context, resp any, err error)
- func WriteOk(c *gin.Context)
- func WriteWithCache(filename string, w http.ResponseWriter, r *http.Request)
- type Adapter
- type AdapterEditorContext
- type AdapterHandle
- type AdapterHub
- type Builder
- type BuilderOptions
- type CacheLoader
- type Context
- type GlobalCache
- type Request
- type Rutil
- type SubCache
Constants ¶
This section is empty.
Variables ¶
View Source
var (
MessageOk = []byte(`{"message": "success"}`)
)
Functions ¶
func ApiBaseURL ¶
func UnAuthorized ¶
func WriteBinary ¶
func WriteErrString ¶
func WriteFinal ¶
func WriteWithCache ¶
func WriteWithCache(filename string, w http.ResponseWriter, r *http.Request)
Types ¶
type AdapterEditorContext ¶
type AdapterEditorContext struct { Id int64 User *claim.UserContext Name string Data []byte }
type AdapterHandle ¶
type AdapterHub ¶
type AdapterHub interface { Serve(ctx *gin.Context) IsAllowed(tenantId, host string) bool ApplyTargetHook(tenantId string, id int64, data *entities.TargetHook) ApplyAdapter(tenantId string, id int64, data *entities.TenantDomain) PreformEditorAction(ctx AdapterEditorContext) (any, error) ListAdapters() []string ServeEditorFile(tenantId, file string, did int64, ctx *gin.Context) ServePublic(file string, ctx *gin.Context) }
type Builder ¶
type Builder func(opts BuilderOptions) (Adapter, error)
type BuilderOptions ¶
type BuilderOptions struct { App xtypes.App TenantId string Domain *entities.TenantDomain Handle AdapterHandle Cache GlobalCache }
type CacheLoader ¶
type GlobalCache ¶
type GlobalCache interface {
GetSubCache(key string, loader CacheLoader) (SubCache, error)
}
Click to show internal directories.
Click to hide internal directories.