Documentation ¶
Index ¶
- func DecodeSourceModelName(req *restful.Request) (string, string)
- func GetUsername(req *restful.Request) string
- func ParseCommonListOptions(r *restful.Request) repository.CommonListOptions
- type CommentResponse
- type ModelResponse
- type ModelsAPI
- func (o *ModelsAPI) AddSourceAdmin(req *restful.Request, resp *restful.Response)
- func (m ModelsAPI) AdminCheckSource(req *restful.Request, resp *restful.Response)
- func (m ModelsAPI) AdminCreateSource(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) AdminDeleteModel(req *restful.Request, resp *restful.Response)
- func (m ModelsAPI) AdminDeleteSource(req *restful.Request, resp *restful.Response)
- func (m ModelsAPI) AdminGetSource(req *restful.Request, resp *restful.Response)
- func (m ModelsAPI) AdminListModel(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) AdminListSelector(req *restful.Request, resp *restful.Response)
- func (m ModelsAPI) AdminListSources(req *restful.Request, resp *restful.Response)
- func (m ModelsAPI) AdminUpdateModel(req *restful.Request, resp *restful.Response)
- func (m ModelsAPI) AdminUpdateSource(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) CreateComment(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) DeleteComment(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) DeleteModel(req *restful.Request, resp *restful.Response)
- func (o *ModelsAPI) DeleteSourceAdmin(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) GetModel(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) GetRating(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) GetSource(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) GetVersion(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) InitSchemas(ctx context.Context) error
- func (m *ModelsAPI) ListComments(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) ListModels(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) ListSelectors(req *restful.Request, resp *restful.Response)
- func (o *ModelsAPI) ListSourceAdmin(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) ListSources(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) ListVersions(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) RegisterRoute(rg *route.Group)
- func (m *ModelsAPI) StartSync(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) StopSync(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) SyncModel(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) SyncStatus(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) UpdateComment(req *restful.Request, resp *restful.Response)
- func (m *ModelsAPI) UpsertModel(req *restful.Request, resp *restful.Response)
- type ModelxSync
- func (m *ModelxSync) Stop(ctx context.Context, source *repository.SourceWithAddtional) error
- func (m *ModelxSync) Sync(ctx context.Context, source *repository.SourceWithAddtional) error
- func (m *ModelxSync) SyncOne(ctx context.Context, source *repository.SourceWithAddtional, repo string) (any, error)
- func (m *ModelxSync) SyncStatus(ctx context.Context, source *repository.SourceWithAddtional) (*SyncStatus, error)
- type SimpleModel
- type SourceWithSyncStatus
- type SyncOptions
- type SyncService
- func (s *SyncService) Stop(ctx context.Context, source *repository.SourceWithAddtional, query url.Values) error
- func (s *SyncService) Sync(ctx context.Context, source *repository.SourceWithAddtional, query url.Values) error
- func (s *SyncService) SyncOne(ctx context.Context, source *repository.SourceWithAddtional, repo string) (any, error)
- func (s *SyncService) SyncStatus(ctx context.Context, source *repository.SourceWithAddtional) (*SyncStatus, error)
- type SyncServiceSyncStatus
- type SyncStatus
- type SyncStatusPhase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeSourceModelName ¶
func GetUsername ¶
func GetUsername(req *restful.Request) string
func ParseCommonListOptions ¶
func ParseCommonListOptions(r *restful.Request) repository.CommonListOptions
nolint: gomnd
Types ¶
type CommentResponse ¶
type CommentResponse struct { repository.Comment Replies []repository.Comment `json:"replies"` }
type ModelResponse ¶
type ModelResponse struct { repository.Model Rating repository.Rating `json:"rating"` Versions []string `json:"versions"` // not used }
type ModelsAPI ¶
type ModelsAPI struct { ModelRepository *repository.ModelsRepository CommentRepository *repository.CommentsRepository SourcesRepository *repository.SourcesRepository SyncService *SyncService // contains filtered or unexported fields }
func NewModelsAPI ¶
func (*ModelsAPI) AddSourceAdmin ¶
func (o *ModelsAPI) AddSourceAdmin(req *restful.Request, resp *restful.Response)
func (ModelsAPI) AdminCheckSource ¶
func (m ModelsAPI) AdminCheckSource(req *restful.Request, resp *restful.Response)
func (ModelsAPI) AdminCreateSource ¶
func (m ModelsAPI) AdminCreateSource(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) AdminDeleteModel ¶
func (m *ModelsAPI) AdminDeleteModel(req *restful.Request, resp *restful.Response)
func (ModelsAPI) AdminDeleteSource ¶
func (m ModelsAPI) AdminDeleteSource(req *restful.Request, resp *restful.Response)
func (ModelsAPI) AdminGetSource ¶
func (m ModelsAPI) AdminGetSource(req *restful.Request, resp *restful.Response)
func (ModelsAPI) AdminListModel ¶
func (m ModelsAPI) AdminListModel(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) AdminListSelector ¶
func (m *ModelsAPI) AdminListSelector(req *restful.Request, resp *restful.Response)
func (ModelsAPI) AdminListSources ¶
func (m ModelsAPI) AdminListSources(req *restful.Request, resp *restful.Response)
func (ModelsAPI) AdminUpdateModel ¶
func (m ModelsAPI) AdminUpdateModel(req *restful.Request, resp *restful.Response)
func (ModelsAPI) AdminUpdateSource ¶
func (m ModelsAPI) AdminUpdateSource(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) CreateComment ¶
func (m *ModelsAPI) CreateComment(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) DeleteComment ¶
func (m *ModelsAPI) DeleteComment(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) DeleteModel ¶
func (m *ModelsAPI) DeleteModel(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) DeleteSourceAdmin ¶
func (o *ModelsAPI) DeleteSourceAdmin(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) GetModel ¶
func (m *ModelsAPI) GetModel(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) GetRating ¶
func (m *ModelsAPI) GetRating(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) GetSource ¶
func (m *ModelsAPI) GetSource(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) GetVersion ¶
func (m *ModelsAPI) GetVersion(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) ListComments ¶
func (m *ModelsAPI) ListComments(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) ListModels ¶
func (m *ModelsAPI) ListModels(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) ListSelectors ¶
func (m *ModelsAPI) ListSelectors(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) ListSourceAdmin ¶
func (o *ModelsAPI) ListSourceAdmin(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) ListSources ¶
func (m *ModelsAPI) ListSources(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) ListVersions ¶
func (m *ModelsAPI) ListVersions(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) RegisterRoute ¶
func (*ModelsAPI) StartSync ¶
func (m *ModelsAPI) StartSync(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) StopSync ¶
func (m *ModelsAPI) StopSync(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) SyncModel ¶
func (m *ModelsAPI) SyncModel(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) SyncStatus ¶
func (m *ModelsAPI) SyncStatus(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) UpdateComment ¶
func (m *ModelsAPI) UpdateComment(req *restful.Request, resp *restful.Response)
func (*ModelsAPI) UpsertModel ¶ added in v1.23.12
func (m *ModelsAPI) UpsertModel(req *restful.Request, resp *restful.Response)
type ModelxSync ¶ added in v1.23.8
type ModelxSync struct {
// contains filtered or unexported fields
}
func (*ModelxSync) Stop ¶ added in v1.23.8
func (m *ModelxSync) Stop(ctx context.Context, source *repository.SourceWithAddtional) error
func (*ModelxSync) Sync ¶ added in v1.23.8
func (m *ModelxSync) Sync(ctx context.Context, source *repository.SourceWithAddtional) error
func (*ModelxSync) SyncOne ¶ added in v1.23.8
func (m *ModelxSync) SyncOne(ctx context.Context, source *repository.SourceWithAddtional, repo string) (any, error)
func (*ModelxSync) SyncStatus ¶ added in v1.23.8
func (m *ModelxSync) SyncStatus(ctx context.Context, source *repository.SourceWithAddtional) (*SyncStatus, error)
type SimpleModel ¶
type SourceWithSyncStatus ¶
type SourceWithSyncStatus struct { repository.SourceWithAddtional `json:",inline"` SyncStatus SyncStatus `json:"syncStatus"` }
type SyncOptions ¶
type SyncOptions struct {
Addr string `json:"addr" description:"address of the sync service"`
}
func NewDefaultSyncOptions ¶
func NewDefaultSyncOptions() *SyncOptions
type SyncService ¶
type SyncService struct {
// contains filtered or unexported fields
}
func NewSyncService ¶
func NewSyncService(syncopt *SyncOptions, sources *repository.SourcesRepository, models *repository.ModelsRepository) *SyncService
func (*SyncService) Stop ¶
func (s *SyncService) Stop(ctx context.Context, source *repository.SourceWithAddtional, query url.Values) error
func (*SyncService) Sync ¶
func (s *SyncService) Sync(ctx context.Context, source *repository.SourceWithAddtional, query url.Values) error
func (*SyncService) SyncOne ¶
func (s *SyncService) SyncOne(ctx context.Context, source *repository.SourceWithAddtional, repo string) (any, error)
func (*SyncService) SyncStatus ¶
func (s *SyncService) SyncStatus(ctx context.Context, source *repository.SourceWithAddtional) (*SyncStatus, error)
type SyncServiceSyncStatus ¶
type SyncStatus ¶
type SyncStatus struct { Status SyncStatusPhase `json:"status"` Progress string `json:"progress"` // eg. 5/34 StartedAt *time.Time `json:"startedAt"` FinishedAt *time.Time `json:"finishedAt"` Message string `json:"message"` }
func SyncStatusFrom ¶
func SyncStatusFrom(status *SyncServiceSyncStatus) *SyncStatus
type SyncStatusPhase ¶ added in v1.23.8
type SyncStatusPhase string
const ( SyncStatusRunning SyncStatusPhase = "PROGRESS" SyncStatusStopped SyncStatusPhase = "STOP" SyncStatusSuccess SyncStatusPhase = "SUCCESS" SyncStatusFailed SyncStatusPhase = "FAILURE" )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.