}
}
+// RequireResource defines resource that required by an operation.
+type RequireResource struct {
+ Operation string // add, del, set, get, list, upload, download, view, print, edit...
+ FileIds []string // fs_file_id
+ ShareIds []string // fs_share_id
+}
+
+// TokenCheckFunc defines function type of check client privilege by token.
+type TokenCheckFunc func(token string, options ...interface{}) bool
+
// Instance is the framework's instance, used for server & plugin both.
type Instance struct {
- Conf *Configuration // configuration of this application.
- Db *sqlx.DB // the first database connection created by main routine.
- Logger *logger.Logger // logger created by main routine.
- Router *gin.Engine // default webservice engine created by main routine.
- Maintenance bool // when maintenance mode is true, only serve api /config.
+ Conf *Configuration // configuration of this application.
+ Db *sqlx.DB // the first database connection created by main routine.
+ Logger *logger.Logger // logger created by main routine.
+ Router *gin.Engine // default webservice engine created by main routine.
+ Maintenance bool // when maintenance mode is true, only serve api /config.
+ CheckToken *TokenCheckFunc // pointer of check token function.
}