service

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminChannelModels added in v0.0.6

func AdminChannelModels(index *int, channel model.ModelChannel) ([]string, error)

func AdminSettings added in v0.0.6

func AdminSettings() (model.Settings, error)

func AdminTestChannelModel added in v0.0.6

func AdminTestChannelModel(index *int, channel model.ModelChannel, modelName string) (string, error)

func BuildModelChannelURL added in v0.0.6

func BuildModelChannelURL(channel model.ModelChannel, path string) string

func CurrentAuthUser

func CurrentAuthUser(tokenText string) (model.AuthUser, bool)

func DeleteAsset

func DeleteAsset(id string) error

func DeletePrompt

func DeletePrompt(id string) error

func DeletePrompts added in v0.0.7

func DeletePrompts(ids []string) error

func DeleteUser

func DeleteUser(id string) error

func EnsureDefaultAdmin

func EnsureDefaultAdmin() error

func GuestUser

func GuestUser() model.AuthUser

func ListAssets

func ListAssets(q model.Query) (model.AssetList, error)

func ListPromptCategories

func ListPromptCategories() []model.PromptCategory

func ListPrompts

func ListPrompts(q model.Query) (model.PromptList, error)

func ListUsers

func ListUsers(q model.Query) (model.UserList, error)

func Login

func Login(username string, password string) (model.AuthSession, error)

func PublicSettings added in v0.0.6

func PublicSettings() (model.PublicSetting, error)

func RefreshPromptSyncScheduler added in v0.0.7

func RefreshPromptSyncScheduler()

func Register

func Register(username string, password string) (model.AuthSession, error)

func SaveAsset

func SaveAsset(item model.Asset) (model.Asset, error)

func SavePrompt

func SavePrompt(item model.Prompt) (model.Prompt, error)

func SaveSettings added in v0.0.6

func SaveSettings(settings model.Settings) (model.Settings, error)

func SaveUser

func SaveUser(user model.User, password string) (model.User, error)

func SelectModelChannel added in v0.0.6

func SelectModelChannel(modelName string) (model.ModelChannel, error)

func StartPromptSyncScheduler added in v0.0.7

func StartPromptSyncScheduler()

func SyncPromptCategory

func SyncPromptCategory(category string) ([]model.PromptCategory, error)

func SyncRemotePromptCategories added in v0.0.7

func SyncRemotePromptCategories()

func UserFromContext

func UserFromContext(ctx context.Context) (model.AuthUser, bool)

func WarnDefaultSecurityConfig

func WarnDefaultSecurityConfig()

func WithUser

func WithUser(ctx context.Context, user model.AuthUser) context.Context

Types

type TokenClaims

type TokenClaims struct {
	UserID   string         `json:"userId"`
	Username string         `json:"username"`
	Role     model.UserRole `json:"role"`
	jwt.RegisteredClaims
}

func ParseToken

func ParseToken(tokenText string) (TokenClaims, error)

Jump to

Keyboard shortcuts

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