Documentation ¶
Index ¶
- Constants
- type OpenAPICacheEntry
- type OpenAPICacheInterface
- type Plugin
- func (p *Plugin) AddPlugin(ctx context.Context, plugin *model.Plugin) error
- func (p *Plugin) CheckExist(ctx context.Context, name string) bool
- func (p *Plugin) FetchAiPluginInfo(aiPluginURL string) (model.AiPlugin, error)
- func (p *Plugin) GeneratePluginModel(ctx context.Context, domain, label string, ai model.AiPlugin) model.Plugin
- func (p *Plugin) GeneratePluginURL(ctx context.Context, domain string) string
- func (p *Plugin) ListPluginByFuzzyName(ctx context.Context, fuzzyName, sortFieldName string, orderBy types.OrderBy, ...) ([]*model.Plugin, error)
- func (p *Plugin) UpdatePluginScoreAndHeat(ctx context.Context, ID, heat int32, score float64) error
- type PluginMetadata
- func (p *PluginMetadata) AddPluginMetadata(ctx context.Context, metadata model.PluginMetadata) error
- func (p *PluginMetadata) GeneratePluginMetadata(ctx context.Context, pluginID int, pluginURL string) model.PluginMetadata
- func (p *PluginMetadata) UpdatePluginMetadata(ctx context.Context, metadata model.PluginMetadata) error
- type PluginScore
Constants ¶
View Source
const ( // DefaultCacheDir is the default directory for the cache dir. DefaultCacheDir = "." // DefaultCacheFileName is the default name of the cache file. DefaultCacheFileName = "openapi_cache.json" // DefaultOpenAPIDirName is the default name of the openapi file dir. DefaultOpenAPIDirName = "openapi" )
View Source
const (
AiPluginURLPath = "/.well-known/ai-plugin.json"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OpenAPICacheEntry ¶
type OpenAPICacheInterface ¶
type OpenAPICacheInterface interface { // Get returns the OpenAPICacheEntry for the given url if it exists in the cache. Get(key string) (OpenAPICacheEntry, bool) // Set adds or updates the given entry for the given url in the cache. Set(key string, entry OpenAPICacheEntry) error // IsNotExpires check cache is expires IsNotExpires(key, etag, lastModified string) bool // Key returns the cache key for the given apiUrl. Key(apiURL string) string }
func NewOpenAPICache ¶
func NewOpenAPICache(dir, fileName string) OpenAPICacheInterface
type Plugin ¶
type Plugin struct {
PluginInfra db.PluginInfraInterface
}
func (*Plugin) FetchAiPluginInfo ¶
func (*Plugin) GeneratePluginModel ¶
func (*Plugin) GeneratePluginURL ¶
func (*Plugin) ListPluginByFuzzyName ¶
type PluginMetadata ¶
type PluginMetadata struct {
PluginMetadataInfra db.PluginMetadataInfraInterface
}
func NewPluginMetadata ¶
func NewPluginMetadata(mysqlConf *config.MysqlOptions) (*PluginMetadata, error)
func (*PluginMetadata) AddPluginMetadata ¶
func (p *PluginMetadata) AddPluginMetadata(ctx context.Context, metadata model.PluginMetadata) error
func (*PluginMetadata) GeneratePluginMetadata ¶
func (p *PluginMetadata) GeneratePluginMetadata(ctx context.Context, pluginID int, pluginURL string) model.PluginMetadata
func (*PluginMetadata) UpdatePluginMetadata ¶
func (p *PluginMetadata) UpdatePluginMetadata(ctx context.Context, metadata model.PluginMetadata) error
type PluginScore ¶
type PluginScore struct {
PluginScoreInfra db.PluginScoreInfraInterface
}
func NewPluginScore ¶
func NewPluginScore(mysqlConf *config.MysqlOptions) (*PluginScore, error)
func (*PluginScore) AddPluginScore ¶
func (p *PluginScore) AddPluginScore(ctx context.Context, score model.PluginScore) error
func (*PluginScore) CalculateRating ¶
func (*PluginScore) ListPluginScoreByID ¶
func (p *PluginScore) ListPluginScoreByID(ctx context.Context, pluginID int) ([]*model.PluginScore, error)
Click to show internal directories.
Click to hide internal directories.