Documentation ¶
Index ¶
- Variables
- func Lockfile() (lockfile.Lockfile, error)
- func Running() bool
- func TryAcquire() bool
- type Collection
- func (c *Collection[K, V]) Clear()
- func (c *Collection[K, V]) Count() (count int)
- func (c *Collection[K, V]) Delete(key K)
- func (c *Collection[K, V]) Get(key K) (value V, ok bool)
- func (c *Collection[K, V]) Has(key K) bool
- func (c *Collection[K, V]) Insert(key K, value V) (inserted bool)
- func (c *Collection[K, V]) MarshalKey(k K) []byte
- func (c *Collection[K, V]) MarshalValue(v V) []byte
- func (c *Collection[K, V]) Open(db *badger.DB, prefix string)
- func (c *Collection[K, V]) Range(f func(key K, item V) bool)
- func (c *Collection[K, V]) Replace(key K, value V) (prev V, existed bool)
- func (c *Collection[K, V]) UnmarshalKey(k *K, b []byte) error
- func (c *Collection[K, V]) UnmarshalValue(v *V, b []byte) error
- func (c *Collection[K, V]) Upsert(key K, cb func(value *V) V)
- type DaemonService
- type EventService
- type JobService
- func (s *JobService) Delete(match *string, list *[]string) error
- func (s *JobService) Kill(match *string, list *[]string) error
- func (s *JobService) Launch(recipe job.Manifest, result *RpcJobInfo) error
- func (s *JobService) List(match *string, result *RpcSessionJobs) error
- func (s *JobService) Restart(match *string, list *[]string) error
- func (s *JobService) Start(match *string, list *[]string) error
- func (s *JobService) Stop(match *string, list *[]string) error
- func (s *JobService) Update(recipe job.Manifest, result *RpcJobInfo) error
- type RpcJobInfo
- type RpcLogMessage
- type RpcSessionJobs
- type RpcStatus
- type RpcTaskInfo
- type RpcWhiteboardKey
- type RpcWhiteboardKv
- type Session
- func (s *Session) Close(err error)
- func (s *Session) DeleteJob(id string) error
- func (s *Session) ForEachJob(match string, cb func(j *job.Job) error) (e error)
- func (s *Session) ForEachJobRgx(pattern *regexp.Regexp, cb func(j *job.Job) error) (e error)
- func (s *Session) InsertJob(j *job.Job) error
- func (s *Session) LogsHandler(w http.ResponseWriter, r *http.Request)
- func (s *Session) StopAll(timeout time.Duration)
- func (s *Session) UpdateJob(j *job.Job)
- func (s *Session) Wait() error
- type WhiteboardService
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAlreadyExists = errors.New("job already exists")
View Source
var ErrNotFound = errors.New("job not found")
Functions ¶
func TryAcquire ¶
func TryAcquire() bool
Types ¶
type Collection ¶
Collections.
func (*Collection[K, V]) Clear ¶
func (c *Collection[K, V]) Clear()
func (*Collection[K, V]) Count ¶
func (c *Collection[K, V]) Count() (count int)
func (*Collection[K, V]) Delete ¶
func (c *Collection[K, V]) Delete(key K)
func (*Collection[K, V]) Get ¶
func (c *Collection[K, V]) Get(key K) (value V, ok bool)
func (*Collection[K, V]) Has ¶
func (c *Collection[K, V]) Has(key K) bool
func (*Collection[K, V]) Insert ¶
func (c *Collection[K, V]) Insert(key K, value V) (inserted bool)
func (*Collection[K, V]) MarshalKey ¶
func (c *Collection[K, V]) MarshalKey(k K) []byte
func (*Collection[K, V]) MarshalValue ¶
func (c *Collection[K, V]) MarshalValue(v V) []byte
func (*Collection[K, V]) Open ¶
func (c *Collection[K, V]) Open(db *badger.DB, prefix string)
func (*Collection[K, V]) Range ¶
func (c *Collection[K, V]) Range(f func(key K, item V) bool)
func (*Collection[K, V]) Replace ¶
func (c *Collection[K, V]) Replace(key K, value V) (prev V, existed bool)
func (*Collection[K, V]) UnmarshalKey ¶
func (c *Collection[K, V]) UnmarshalKey(k *K, b []byte) error
func (*Collection[K, V]) UnmarshalValue ¶
func (c *Collection[K, V]) UnmarshalValue(v *V, b []byte) error
func (*Collection[K, V]) Upsert ¶
func (c *Collection[K, V]) Upsert(key K, cb func(value *V) V)
type DaemonService ¶
type DaemonService struct {
// contains filtered or unexported fields
}
func (*DaemonService) Ping ¶
func (s *DaemonService) Ping(x, y *int) error
type EventService ¶
type EventService struct {
// contains filtered or unexported fields
}
type JobService ¶
type JobService struct {
// contains filtered or unexported fields
}
func (*JobService) Launch ¶
func (s *JobService) Launch(recipe job.Manifest, result *RpcJobInfo) error
func (*JobService) List ¶
func (s *JobService) List(match *string, result *RpcSessionJobs) error
func (*JobService) Update ¶
func (s *JobService) Update(recipe job.Manifest, result *RpcJobInfo) error
type RpcJobInfo ¶
type RpcJobInfo struct { ID string `json:"id"` Main RpcTaskInfo `json:"main"` }
type RpcLogMessage ¶
type RpcSessionJobs ¶
type RpcSessionJobs struct {
Jobs []RpcJobInfo `json:"jobs"`
}
type RpcTaskInfo ¶
type RpcTaskInfo struct { Namespace string `json:"namespace"` Status RpcStatus `json:"status"` Report task.Report `json:"report,omitempty"` Children []RpcTaskInfo `json:"children,omitempty"` }
type RpcWhiteboardKey ¶
type RpcWhiteboardKv ¶
type RpcWhiteboardKv struct { RpcWhiteboardKey Value json.RawMessage `json:"value,omitempty"` }
type Session ¶
type Session struct { Database *badger.DB RpcServer *surpc.Server Jobs sync.Map JobCollection Collection[string, job.Manifest] // contains filtered or unexported fields }
func (*Session) ForEachJob ¶
func (*Session) ForEachJobRgx ¶
func (*Session) LogsHandler ¶
func (s *Session) LogsHandler(w http.ResponseWriter, r *http.Request)
type WhiteboardService ¶
type WhiteboardService struct {
// contains filtered or unexported fields
}
func (*WhiteboardService) Get ¶
func (s *WhiteboardService) Get(key *RpcWhiteboardKey, out *[]RpcWhiteboardKv) error
func (*WhiteboardService) Put ¶
func (s *WhiteboardService) Put(key *RpcWhiteboardKv, count *int) error
Click to show internal directories.
Click to hide internal directories.