db

package
v0.0.0-...-e1cdcfb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MysqlServer

type MysqlServer struct {
	PluginInfraInterface
}

type PluginInfraInterface

type PluginInfraInterface interface {
	// GetPluginByID returns plugin by id
	GetPluginByID(ctx context.Context, id string) (*model.Plugin, error)
	// GetPluginByName returns plugin by name
	GetPluginByName(ctx context.Context, name string) (*model.Plugin, error)
	// ListPlugins returns all plugins
	ListPlugins(ctx context.Context, limit, offset int32, orderBy, sortFieldName string, fuzzyName ...string) ([]*model.Plugin, error)
	// CreatePlugin creates a plugin
	CreatePlugin(ctx context.Context, plugin *model.Plugin) error
	// CountPlugins returns the number of plugins
	CountPlugins(ctx context.Context, fuzzyName ...string) (int, error)
	// UpdatePluginScoreAndHeat updates plugin state
	UpdatePluginScoreAndHeat(ctx context.Context, id, heat int32, score float64) error
	// UpdatePluginState updates plugin state
	GetPluginByAPIURL(ctx context.Context, apiURL string) (*model.Plugin, error)
}

func NewPluginInfra

func NewPluginInfra(mysqlConf *config.MysqlOptions) (PluginInfraInterface, error)

type PluginMetadataInfraInterface

type PluginMetadataInfraInterface interface {
	InsertPluginMetadata(ctx context.Context, metadata model.PluginMetadata) error
	SelectPluginMetaDataBase(ctx context.Context, pluginID int) (*model.PluginMetadata, error)
	SelectPluginMetaDataAll(ctx context.Context, pluginID int) (*model.PluginMetadata, error)
	UpdatePluginMetadata(ctx context.Context, metadata model.PluginMetadata) error
}

func NewPluginMetadataInfra

func NewPluginMetadataInfra(mysqlConf *config.MysqlOptions) (PluginMetadataInfraInterface, error)

type PluginScoreInfraInterface

type PluginScoreInfraInterface interface {
	InsertPluginScore(ctx context.Context, score model.PluginScore) error
	SelectPluginScore(ctx context.Context, pluginID int) ([]*model.PluginScore, error)
}

func NewPluginScoreInfra

func NewPluginScoreInfra(mysqlConf *config.MysqlOptions) (PluginScoreInfraInterface, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL