Documentation ¶
Index ¶
- Constants
- Variables
- type APIKey
- type APIKeyRepository
- func (ak *APIKeyRepository) Create(ctx context.Context, key apikey.APIKey) (apikey.APIKey, error)
- func (c *APIKeyRepository) DeleteByID(ctx context.Context, id string) error
- func (c *APIKeyRepository) Get(ctx context.Context, id string) (apikey.APIKey, error)
- func (c *APIKeyRepository) GetAll(ctx context.Context) ([]apikey.APIKey, error)
- func (c *APIKeyRepository) GetByToken(ctx context.Context, token string) (apikey.APIKey, error)
- func (c *APIKeyRepository) Update(ctx context.Context, key apikey.APIKey) (apikey.APIKey, error)
- type Crypto
- type CryptoNoop
- type Encryptor
- type PromptDB
- type PromptRepository
- func (*PromptRepository) DeleteByID(ctx context.Context, connID uuid.UUID) error
- func (c *PromptRepository) GetAll(ctx context.Context) ([]prompt.Prompt, error)
- func (*PromptRepository) GetByID(ctx context.Context, connID uuid.UUID) (prompt.Prompt, error)
- func (c *PromptRepository) GetByName(ctx context.Context, name string) (prompt.Prompt, error)
- func (c *PromptRepository) Upsert(ctx context.Context, conn prompt.Prompt) (prompt.Prompt, error)
- type ProviderDB
- type ProviderRepository
- func (*ProviderRepository) DeleteByID(ctx context.Context, connID uuid.UUID) error
- func (c *ProviderRepository) GetAll(ctx context.Context) ([]provider.Provider, error)
- func (*ProviderRepository) GetByID(ctx context.Context, connID uuid.UUID) (provider.Provider, error)
- func (c *ProviderRepository) GetByName(ctx context.Context, name string) (provider.Provider, error)
- func (c *ProviderRepository) Upsert(ctx context.Context, pr provider.Provider) (provider.Provider, error)
Constants ¶
View Source
const ( TABLE_PROVIDERS = "providers" TABLE_PROMPTS = "prompts" TABLE_APIKEYS = "apikeys" )
Variables ¶
View Source
var ( ErrDuplicateKey = errors.New("duplicate key") ErrCheckViolation = errors.New("check constraint violation") ErrForeignKeyViolation = errors.New("foreign key violation") ErrInvalidTextRepresentation = errors.New("invalid input syntax type") ErrInvalidID = errors.New("invalid id") )
View Source
var ( ErrConflict = errors.New("provider already exist") ErrNotExist = errors.New("apikey or its relations doesn't exist") )
Functions ¶
This section is empty.
Types ¶
type APIKey ¶
type APIKeyRepository ¶
type APIKeyRepository struct {
// contains filtered or unexported fields
}
func NewAPIKeyRepository ¶
func NewAPIKeyRepository(dbc *database.Client) *APIKeyRepository
func (*APIKeyRepository) DeleteByID ¶
func (c *APIKeyRepository) DeleteByID(ctx context.Context, id string) error
func (*APIKeyRepository) GetByToken ¶
type Crypto ¶
type Crypto struct {
// contains filtered or unexported fields
}
type CryptoNoop ¶
type CryptoNoop struct{}
type PromptDB ¶
type PromptRepository ¶
type PromptRepository struct {
// contains filtered or unexported fields
}
func NewPromptRepository ¶
func NewPromptRepository(dbc *database.Client) *PromptRepository
func (*PromptRepository) DeleteByID ¶
type ProviderDB ¶
type ProviderDB struct { ID uuid.UUID `db:"id"` Name string `db:"name"` Config []byte `db:"config"` UpdatedAt time.Time `db:"updated_at"` CreatedAt time.Time `db:"created_at"` }
func (ProviderDB) ToProvider ¶
func (c ProviderDB) ToProvider() (provider.Provider, error)
type ProviderRepository ¶
type ProviderRepository struct {
// contains filtered or unexported fields
}
func NewProviderRepository ¶
func NewProviderRepository(dbc *database.Client) *ProviderRepository
func (*ProviderRepository) DeleteByID ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.