model

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 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 DBClient

type DBClient struct {
	DB *gorm.DB
}

func (*DBClient) Create

func (dbClient *DBClient) Create(ctx context.Context, req *pb.ModelCreateRequest) (*pb.Model, error)

func (*DBClient) Delete

func (dbClient *DBClient) Delete(ctx context.Context, req *pb.ModelDeleteRequest) (*commonpb.VoidResponse, error)

func (*DBClient) Get

func (dbClient *DBClient) Get(ctx context.Context, req *pb.ModelGetRequest) (*pb.Model, error)

func (*DBClient) Paging

func (dbClient *DBClient) Paging(ctx context.Context, req *pb.ModelPagingRequest) (*pb.ModelPagingResponse, error)

func (*DBClient) Update

func (dbClient *DBClient) Update(ctx context.Context, req *pb.ModelUpdateRequest) (*pb.Model, error)

type Model

type Model struct {
	common.BaseModel
	Name       string               `gorm:"column:name;type:varchar(191)" json:"name" yaml:"name"`
	Desc       string               `gorm:"column:desc;type:varchar(1024)" json:"desc" yaml:"desc"`
	Type       model_type.ModelType `gorm:"column:type;type:varchar(32)" json:"type" yaml:"type"`
	ProviderID string               `gorm:"column:provider_id;type:char(36)" json:"providerID" yaml:"providerID"`
	APIKey     string               `gorm:"column:api_key;type:varchar(191)" json:"aPIKey" yaml:"aPIKey"`
	Metadata   metadata.Metadata    `gorm:"column:metadata;type:mediumtext" json:"metadata" yaml:"metadata"`
}

func (*Model) TableName

func (*Model) TableName() string

func (*Model) ToProtobuf

func (m *Model) ToProtobuf() *pb.Model

type Models

type Models []*Model

func (Models) ToProtobuf

func (models Models) ToProtobuf() []*pb.Model

Jump to

Keyboard shortcuts

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