Documentation ¶
Index ¶
- Variables
- func RenderMarkdown(src []byte, opt *Option) (out []byte, err error)
- func ReplaceEmoji(src []byte) (out []byte)
- func SetLoggerOutput(w io.Writer)
- type API
- type Cond
- type Content
- type DependMap
- type GToken
- type GhClient
- type NopReadSeeker
- type Option
- type PluginCounts
- type PluginInfo
- type PluginLabels
- type PluginListOpt
- type PluginRelease
- type RequireMap
- type StatusCodeErr
- type Version
- func (v Version) Equal(o Version) bool
- func (v Version) Get(i int) int
- func (v Version) Less(o Version) bool
- func (v Version) MarshalJSON() ([]byte, error)
- func (v *Version) Scan(d any) (err error)
- func (v Version) String() (s string)
- func (v *Version) UnmarshalJSON(data []byte) (err error)
- func (v Version) Value() (driver.Value, error)
- type VersionCond
- type VersionCondList
- func (vl VersionCondList) IsMatch(v Version) bool
- func (v VersionCondList) MarshalJSON() ([]byte, error)
- func (v *VersionCondList) Scan(d any) (err error)
- func (v VersionCondList) String() (s string)
- func (v *VersionCondList) UnmarshalJSON(data []byte) (err error)
- func (v VersionCondList) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BASE_DIR string = "/opt/pwebpoint" PLUGIN_DIR string = filepath.Join(BASE_DIR, "plugin") CACHE_DIR string = filepath.Join(BASE_DIR, "caches") PLUGIN_CACHE_DIR string = filepath.Join(CACHE_DIR, "plugin") )
View Source
var ( PluginIdRe = regexp.MustCompile(`[0-9a-z_]{1,64}`) VersionRe = regexp.MustCompile(`^((?:[xX*]|\d+)(?:\.(?:[xX*]|\d+))*)([-+][-+.0-9A-Za-z]+)?$`) VersionExtraRe = regexp.MustCompile(`^|[-+0-9A-Za-z]+(?:\.[-+0-9A-Za-z]+)*$`) )
View Source
var DEBUG = os.Getenv("DEBUG") == "true"
View Source
var DefaultOption = &Option{}
View Source
var (
ErrNotFound = errors.New("ErrNotFound")
)
View Source
var VersionMatchAny = VersionCond{ Cond: EQ, }
Functions ¶
func RenderMarkdown ¶ added in v0.6.0
func ReplaceEmoji ¶ added in v1.1.0
func SetLoggerOutput ¶ added in v1.2.0
Types ¶
type API ¶
type API interface { GetLastUpdateTime() (modTime time.Time, err error) GetPluginLastUpdateTime(id string) (modTime time.Time, err error) GetPluginCounts(opt PluginListOpt) (count PluginCounts, err error) GetPluginList(opt PluginListOpt) (infos []*PluginInfo, err error) GetPluginIdList(opt PluginListOpt) (ids []string, err error) GetPluginInfo(id string, version string) (info *PluginInfo, err error) GetPluginInfos(id string) (info []*PluginInfo, err error) GetPluginReadme(id string) (content Content, err error) GetPluginReleases(id string) (releases []*PluginRelease, err error) GetPluginRelease(id string, tag Version) (release *PluginRelease, err error) GetPluginReleaseAsset(id string, tag Version, filename string) (rc io.ReadSeekCloser, modTime time.Time, err error) }
type Content ¶ added in v0.6.3
type DependMap ¶
type DependMap map[string]VersionCondList
type GToken ¶ added in v0.6.1
type GhClient ¶ added in v0.7.0
type GhClient struct {
// contains filtered or unexported fields
}
func InitGithubCli ¶ added in v0.7.0
func InitGithubCli() (c *GhClient)
type NopReadSeeker ¶
type NopReadSeeker struct {
io.ReadSeeker
}
func (NopReadSeeker) Close ¶
func (NopReadSeeker) Close() error
type Option ¶ added in v0.6.0
type Option struct { URLPrefix string DataURLPrefix string HeadingIDPrefix string HeadingIDSuffix string }
func (*Option) NewPolicy ¶ added in v0.6.3
func (o *Option) NewPolicy() (p *bluemonday.Policy)
type PluginCounts ¶
type PluginInfo ¶
type PluginInfo struct { Id string `json:"id"` Name string `json:"name"` Version Version `json:"version"` Authors []string `json:"authors"` Desc string `json:"desc,omitempty"` Desc_zhCN string `json:"desc_zhCN,omitempty"` CreateAt time.Time `json:"createAt"` LastRelease *time.Time `json:"lastRelease,omitempty"` Repo string `json:"repo,omitempty"` RepoBranch string `json:"repoBranch,omitempty"` RepoSubdir string `json:"repoSubdir,omitempty"` Link string `json:"link,omitempty"` Labels PluginLabels `json:"labels"` Downloads int64 `json:"downloads"` Dependencies DependMap `json:"dependencies,omitempty"` Requirements RequireMap `json:"requirements,omitempty"` GithubSync bool `json:"github_sync"` GhRepoOwner string `json:"ghRepoOwner,omitempty"` GhRepoName string `json:"ghRepoName,omitempty"` LastSync *time.Time `json:"last_sync,omitempty"` }
type PluginLabels ¶
type PluginListOpt ¶
type PluginRelease ¶
type PluginRelease struct { Id string `json:"id"` Tag Version `json:"tag"` Enabled bool `json:"enabled"` Stable bool `json:"stable"` Size int64 `json:"size"` Uploaded time.Time `json:"uploaded"` FileName string `json:"filename"` Downloads int `json:"downloads"` GithubUrl string `json:"github_url"` }
type RequireMap ¶ added in v0.8.0
type StatusCodeErr ¶
type StatusCodeErr struct {
Code int
}
func (*StatusCodeErr) Error ¶
func (e *StatusCodeErr) Error() string
type Version ¶
func VersionFromString ¶
func (Version) MarshalJSON ¶
func (*Version) UnmarshalJSON ¶
type VersionCond ¶
func VersionCondFromString ¶
func VersionCondFromString(s string) (v VersionCond, err error)
func (VersionCond) IsMatch ¶
func (vc VersionCond) IsMatch(v Version) bool
func (VersionCond) MarshalJSON ¶
func (v VersionCond) MarshalJSON() ([]byte, error)
func (*VersionCond) Scan ¶
func (v *VersionCond) Scan(d any) (err error)
func (VersionCond) String ¶
func (v VersionCond) String() (s string)
func (*VersionCond) UnmarshalJSON ¶
func (v *VersionCond) UnmarshalJSON(data []byte) (err error)
type VersionCondList ¶ added in v1.3.0
type VersionCondList []VersionCond
func VersionCondListFromString ¶ added in v1.3.0
func VersionCondListFromString(s string) (v VersionCondList, err error)
func (VersionCondList) IsMatch ¶ added in v1.3.0
func (vl VersionCondList) IsMatch(v Version) bool
func (VersionCondList) MarshalJSON ¶ added in v1.3.0
func (v VersionCondList) MarshalJSON() ([]byte, error)
func (*VersionCondList) Scan ¶ added in v1.3.0
func (v *VersionCondList) Scan(d any) (err error)
func (VersionCondList) String ¶ added in v1.3.0
func (v VersionCondList) String() (s string)
func (*VersionCondList) UnmarshalJSON ¶ added in v1.3.0
func (v *VersionCondList) UnmarshalJSON(data []byte) (err error)
Click to show internal directories.
Click to hide internal directories.