mirror of
https://github.com/peridotbuild/peridot.git
synced 2024-12-22 10:38:28 +00:00
Allow us to create ApiSecret for worker
This commit is contained in:
parent
fbf14f6c11
commit
cc62ca763e
@ -18,14 +18,18 @@ import (
|
|||||||
"database/sql"
|
"database/sql"
|
||||||
base "go.resf.org/peridot/base/go"
|
base "go.resf.org/peridot/base/go"
|
||||||
mshipadminpb "go.resf.org/peridot/tools/mothership/admin/pb"
|
mshipadminpb "go.resf.org/peridot/tools/mothership/admin/pb"
|
||||||
|
"google.golang.org/protobuf/types/known/timestamppb"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Worker struct {
|
type Worker struct {
|
||||||
PikaTableName string `pika:"workers"`
|
PikaTableName string `pika:"workers"`
|
||||||
|
|
||||||
Name string `json:"name"`
|
Name string `db:"name"`
|
||||||
WorkerID string `json:"worker_id"`
|
CreateTime time.Time `db:"create_time" pika:"omitempty"`
|
||||||
LastCheckinTime sql.NullTime `json:"last_check_in_time"`
|
WorkerID string `db:"worker_id"`
|
||||||
|
LastCheckinTime sql.NullTime `db:"last_checkin_time"`
|
||||||
|
ApiSecret string `db:"api_secret"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *Worker) GetID() string {
|
func (w *Worker) GetID() string {
|
||||||
@ -36,6 +40,7 @@ func (w *Worker) ToPB() *mshipadminpb.Worker {
|
|||||||
return &mshipadminpb.Worker{
|
return &mshipadminpb.Worker{
|
||||||
Name: w.Name,
|
Name: w.Name,
|
||||||
WorkerId: w.WorkerID,
|
WorkerId: w.WorkerID,
|
||||||
|
CreateTime: timestamppb.New(w.CreateTime),
|
||||||
LastCheckinTime: base.SqlNullTime(w.LastCheckinTime),
|
LastCheckinTime: base.SqlNullTime(w.LastCheckinTime),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user