init:初始化项目
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package server
|
||||
|
||||
import "time"
|
||||
|
||||
type SessionRepository interface {
|
||||
CreateSession(upstreamKey string, u user, ttl time.Duration) (session, error)
|
||||
GetSession(token string) (session, bool, error)
|
||||
DeleteSession(token string) error
|
||||
RotateSession(oldToken string, ttl time.Duration) (session, bool, error)
|
||||
}
|
||||
|
||||
type JobRepository interface {
|
||||
CreateJob(record *job) (*job, int, error)
|
||||
GetJob(jobID string) (*job, bool, error)
|
||||
ListJobs(userID, status, skillID, projectID string, limit, offset int) ([]job, int, error)
|
||||
MarkJobRunning(jobID string) (*job, bool, error)
|
||||
LinkUpstreamTask(jobID, upstreamTaskID string) error
|
||||
FailJob(jobID, code, message string, details map[string]any) error
|
||||
CompleteSyncResult(jobID string, refs []resultRef, usage map[string]any) error
|
||||
CancelJob(userID, jobID string) (*job, bool, bool, error)
|
||||
}
|
||||
|
||||
type RouteRepository interface {
|
||||
GetRoutes(projectID string) (map[string]string, error)
|
||||
SetRoute(projectID, routeKey, modelID string) error
|
||||
UnsetRoute(projectID, routeKey string) error
|
||||
}
|
||||
Reference in New Issue
Block a user