action

package
v0.0.0-...-8241179 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache cache.Cache[id.ID, Module]

func NewCache

func NewCache() Cache

type Model

type Model struct {
	bun.BaseModel `bun:"table:action"`

	ID         id.ID        `bun:"id,pk"`
	ProjectID  id.ID        `bun:"project_id"`
	Name       string       `bun:"name"`
	Path       string       `bun:"path"`
	Methods    []string     `bun:"methods,array"`
	Order      int          `bun:"order"`
	ModulePath string       `bun:"module_path"`
	Config     ModuleConfig `bun:"config,type:jsonb"`
	CreatedAt  time.Time    `bun:"created_at"`
	UpdatedAt  time.Time    `bun:"updated_at"`
}

type Module

type Module struct {
	CompiledPlugin       *extism.CompiledPlugin
	PluginInstanceConfig extism.PluginInstanceConfig
}

type ModuleConfig

type ModuleConfig struct {
	Envs    map[string]string `json:"envs,omitempty"`
	Args    []string          `json:"args,omitempty"`
	Network bool              `json:"network,omitempty"`
}

type Repository

type Repository interface {
	Create(ctx context.Context, model *Model) error
	UpdateInfo(ctx context.Context, id id.ID, name, path string, methods []string) error
	GetByID(ctx context.Context, id id.ID) (*Model, bool, error)
	GetByProjectID(ctx context.Context, projectID id.ID) ([]Model, error)
	DeleteByID(ctx context.Context, id id.ID) error
	CountByProjectID(ctx context.Context, projectID id.ID) (int, error)
	UpdateOrder(ctx context.Context, ids []id.ID) error
	UpdateModulePath(ctx context.Context, id id.ID, modulePath string) error
	UpdateConfig(ctx context.Context, id id.ID, config ModuleConfig) error
}

func NewRepository

func NewRepository(tx db.Transaction) Repository

Jump to

Keyboard shortcuts

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