Skip to content

Commit af63118

Browse files
committed
generate schema for cloud-agents
1 parent 4ba7733 commit af63118

File tree

3 files changed

+245
-0
lines changed

3 files changed

+245
-0
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// Code generated; DO NOT EDIT.
2+
3+
package agentsobs
4+
5+
import (
6+
"time"
7+
)
8+
9+
const Version_JDTUL28 = true
10+
11+
type KeyResolver interface {
12+
Resolve(string)
13+
Reset()
14+
}
15+
16+
type Reporter interface {
17+
WithProject(id string) ProjectReporter
18+
WithDeferredProject() (ProjectReporter, KeyResolver)
19+
}
20+
21+
type ProjectReporter interface {
22+
RegisterFunc(func(ts time.Time, tx ProjectTx) bool)
23+
Tx(func(tx ProjectTx))
24+
TxAt(time.Time, func(tx ProjectTx))
25+
WithAgent(name string) AgentReporter
26+
WithDeferredAgent() (AgentReporter, KeyResolver)
27+
}
28+
29+
type ProjectTx interface{}
30+
31+
type AgentReporter interface {
32+
RegisterFunc(func(ts time.Time, tx AgentTx) bool)
33+
Tx(func(tx AgentTx))
34+
TxAt(time.Time, func(tx AgentTx))
35+
WithWorker(id string) WorkerReporter
36+
WithDeferredWorker() (WorkerReporter, KeyResolver)
37+
}
38+
39+
type AgentTx interface{}
40+
41+
type WorkerReporter interface {
42+
RegisterFunc(func(ts time.Time, tx WorkerTx) bool)
43+
Tx(func(tx WorkerTx))
44+
TxAt(time.Time, func(tx WorkerTx))
45+
WithJob(id string) JobReporter
46+
WithDeferredJob() (JobReporter, KeyResolver)
47+
ReportMem(v float32)
48+
ReportCPU(v float32)
49+
ReportLoad(v float32)
50+
ReportStatus(v WorkerStatus)
51+
ReportRegion(v string)
52+
ReportVersion(v string)
53+
ReportStartedAt(v time.Time)
54+
ReportJobsCurrent(v uint16)
55+
ReportKind(v AgentKind)
56+
}
57+
58+
type WorkerTx interface {
59+
ReportMem(v float32)
60+
ReportCPU(v float32)
61+
ReportLoad(v float32)
62+
ReportStatus(v WorkerStatus)
63+
ReportRegion(v string)
64+
ReportVersion(v string)
65+
ReportStartedAt(v time.Time)
66+
ReportJobsCurrent(v uint16)
67+
ReportKind(v AgentKind)
68+
}
69+
70+
type JobReporter interface {
71+
RegisterFunc(func(ts time.Time, tx JobTx) bool)
72+
Tx(func(tx JobTx))
73+
TxAt(time.Time, func(tx JobTx))
74+
ReportRoomSessionID(v string)
75+
ReportKind(v JobKind)
76+
ReportStatus(v JobStatus)
77+
ReportDuration(v uint32)
78+
ReportDispatchedAt(v time.Time)
79+
ReportJoinedAt(v time.Time)
80+
ReportCompletedAt(v time.Time)
81+
}
82+
83+
type JobTx interface {
84+
ReportRoomSessionID(v string)
85+
ReportKind(v JobKind)
86+
ReportStatus(v JobStatus)
87+
ReportDuration(v uint32)
88+
ReportDispatchedAt(v time.Time)
89+
ReportJoinedAt(v time.Time)
90+
ReportCompletedAt(v time.Time)
91+
}
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
// Code generated; DO NOT EDIT.
2+
3+
package agentsobs
4+
5+
import (
6+
"time"
7+
)
8+
9+
var (
10+
_ Reporter = (*noopReporter)(nil)
11+
_ ProjectReporter = (*noopProjectReporter)(nil)
12+
_ AgentReporter = (*noopAgentReporter)(nil)
13+
_ WorkerReporter = (*noopWorkerReporter)(nil)
14+
_ JobReporter = (*noopJobReporter)(nil)
15+
)
16+
17+
type noopKeyResolver struct{}
18+
19+
func (noopKeyResolver) Resolve(string) {}
20+
func (noopKeyResolver) Reset() {}
21+
22+
type noopReporter struct{}
23+
24+
func NewNoopReporter() Reporter {
25+
return &noopReporter{}
26+
}
27+
28+
func (r *noopReporter) WithProject(id string) ProjectReporter {
29+
return &noopProjectReporter{}
30+
}
31+
32+
func (r *noopReporter) WithDeferredProject() (ProjectReporter, KeyResolver) {
33+
return &noopProjectReporter{}, noopKeyResolver{}
34+
}
35+
36+
type noopProjectReporter struct{}
37+
38+
func NewNoopProjectReporter() ProjectReporter {
39+
return &noopProjectReporter{}
40+
}
41+
42+
func (r *noopProjectReporter) RegisterFunc(f func(ts time.Time, tx ProjectTx) bool) {}
43+
func (r *noopProjectReporter) Tx(f func(ProjectTx)) {}
44+
func (r *noopProjectReporter) TxAt(ts time.Time, f func(ProjectTx)) {}
45+
func (r *noopProjectReporter) WithAgent(name string) AgentReporter {
46+
return &noopAgentReporter{}
47+
}
48+
func (r *noopProjectReporter) WithDeferredAgent() (AgentReporter, KeyResolver) {
49+
return &noopAgentReporter{}, noopKeyResolver{}
50+
}
51+
52+
type noopAgentReporter struct{}
53+
54+
func NewNoopAgentReporter() AgentReporter {
55+
return &noopAgentReporter{}
56+
}
57+
58+
func (r *noopAgentReporter) RegisterFunc(f func(ts time.Time, tx AgentTx) bool) {}
59+
func (r *noopAgentReporter) Tx(f func(AgentTx)) {}
60+
func (r *noopAgentReporter) TxAt(ts time.Time, f func(AgentTx)) {}
61+
func (r *noopAgentReporter) WithWorker(id string) WorkerReporter {
62+
return &noopWorkerReporter{}
63+
}
64+
func (r *noopAgentReporter) WithDeferredWorker() (WorkerReporter, KeyResolver) {
65+
return &noopWorkerReporter{}, noopKeyResolver{}
66+
}
67+
68+
type noopWorkerReporter struct{}
69+
70+
func NewNoopWorkerReporter() WorkerReporter {
71+
return &noopWorkerReporter{}
72+
}
73+
74+
func (r *noopWorkerReporter) RegisterFunc(f func(ts time.Time, tx WorkerTx) bool) {}
75+
func (r *noopWorkerReporter) Tx(f func(WorkerTx)) {}
76+
func (r *noopWorkerReporter) TxAt(ts time.Time, f func(WorkerTx)) {}
77+
func (r *noopWorkerReporter) ReportMem(v float32) {}
78+
func (r *noopWorkerReporter) ReportCPU(v float32) {}
79+
func (r *noopWorkerReporter) ReportLoad(v float32) {}
80+
func (r *noopWorkerReporter) ReportStatus(v WorkerStatus) {}
81+
func (r *noopWorkerReporter) ReportRegion(v string) {}
82+
func (r *noopWorkerReporter) ReportVersion(v string) {}
83+
func (r *noopWorkerReporter) ReportStartedAt(v time.Time) {}
84+
func (r *noopWorkerReporter) ReportJobsCurrent(v uint16) {}
85+
func (r *noopWorkerReporter) ReportKind(v AgentKind) {}
86+
func (r *noopWorkerReporter) WithJob(id string) JobReporter {
87+
return &noopJobReporter{}
88+
}
89+
func (r *noopWorkerReporter) WithDeferredJob() (JobReporter, KeyResolver) {
90+
return &noopJobReporter{}, noopKeyResolver{}
91+
}
92+
93+
type noopJobReporter struct{}
94+
95+
func NewNoopJobReporter() JobReporter {
96+
return &noopJobReporter{}
97+
}
98+
99+
func (r *noopJobReporter) RegisterFunc(f func(ts time.Time, tx JobTx) bool) {}
100+
func (r *noopJobReporter) Tx(f func(JobTx)) {}
101+
func (r *noopJobReporter) TxAt(ts time.Time, f func(JobTx)) {}
102+
func (r *noopJobReporter) ReportRoomSessionID(v string) {}
103+
func (r *noopJobReporter) ReportKind(v JobKind) {}
104+
func (r *noopJobReporter) ReportStatus(v JobStatus) {}
105+
func (r *noopJobReporter) ReportDuration(v uint32) {}
106+
func (r *noopJobReporter) ReportDispatchedAt(v time.Time) {}
107+
func (r *noopJobReporter) ReportJoinedAt(v time.Time) {}
108+
func (r *noopJobReporter) ReportCompletedAt(v time.Time) {}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Code generated; DO NOT EDIT.
2+
package agentsobs
3+
4+
type WorkerStatus string
5+
6+
const (
7+
WorkerStatusUndefined WorkerStatus = ""
8+
WorkerStatusAvailable WorkerStatus = "available"
9+
WorkerStatusFull WorkerStatus = "full"
10+
)
11+
12+
type AgentKind string
13+
14+
const (
15+
AgentKindUndefined AgentKind = ""
16+
AgentKindCloud AgentKind = "cloud"
17+
AgentKindSelfhost AgentKind = "selfhost"
18+
)
19+
20+
type JobKind string
21+
22+
const (
23+
JobKindUndefined JobKind = ""
24+
JobKindRoom JobKind = "room"
25+
JobKindPublisher JobKind = "publisher"
26+
JobKindParticipant JobKind = "participant"
27+
)
28+
29+
type JobStatus string
30+
31+
const (
32+
JobStatusUndefined JobStatus = ""
33+
JobStatusPending JobStatus = "pending"
34+
JobStatusRunning JobStatus = "running"
35+
JobStatusSuccess JobStatus = "success"
36+
JobStatusFailed JobStatus = "failed"
37+
)
38+
39+
type Rollup string
40+
41+
const (
42+
RollupUndefined Rollup = ""
43+
RollupWorker Rollup = "worker"
44+
RollupWorkerSeries Rollup = "worker_series"
45+
RollupJob Rollup = "job"
46+
)

0 commit comments

Comments
 (0)