ai_key

package
v1.4.1-beta Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Create

type Create struct {
	ID         string
	Name       string
	Config     string
	Provider   string
	Priority   int
	Status     int
	ExpireTime int
	UseToken   int
	Default    bool
}

type Edit

type Edit struct {
	Name       *string
	Config     *string
	Status     *int
	ExpireTime *int
	Priority   *int
}

type IKeyService

type IKeyService interface {
	universally.IServiceGet[Key]
	universally.IServiceCreate[Create]
	universally.IServiceEdit[Edit]
	universally.IServiceDelete
	DefaultKey(ctx context.Context, providerId string) (*Key, error)
	KeysByProvider(ctx context.Context, providerId string) ([]*Key, error)
	MaxPriority(ctx context.Context, providerId string) (int, error)
	SortBefore(ctx context.Context, provider string, originID string, targetID string) ([]*Key, error)
	SortAfter(ctx context.Context, provider string, originID string, targetID string) ([]*Key, error)
	KeysAfterPriority(ctx context.Context, providerId string, priority int) ([]*Key, error)
	SearchUnExpiredByPage(ctx context.Context, w map[string]interface{}, page, pageSize int, order string) ([]*Key, int64, error)
	IncrUseToken(ctx context.Context, id string, useToken int) error
}

type Key

type Key struct {
	ID         string
	Name       string
	Config     string
	Provider   string
	Status     int
	ExpireTime int
	UseToken   int
	Creator    string
	Updater    string
	Priority   int
	CreateAt   time.Time
	UpdateAt   time.Time
	Default    bool
}

func FromEntity

func FromEntity(e *ai.Key) *Key

Jump to

Keyboard shortcuts

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