mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
* wip * Add delete user command and translator * Add host transfer command * Add changes file * Undo bad refactor * Fix copypaste error * Implement with interfaces instead of assertions * Ad documentation and simplify implementation further * Update docs/1-Using-Fleet/3-REST-API.md Co-authored-by: Zach Wasserman <zach@fleetdm.com> Co-authored-by: Zach Wasserman <zach@fleetdm.com>
26 lines
566 B
Go
26 lines
566 B
Go
package fleet
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
const (
|
|
TranslatorTypeUserEmail = "user"
|
|
TranslatorTypeLabel = "label"
|
|
TranslatorTypeTeam = "team"
|
|
TranslatorTypeHost = "host"
|
|
)
|
|
|
|
type TranslatePayload struct {
|
|
Type string `json:"type"`
|
|
Payload StringIdentifierToIDPayload `json:"payload"`
|
|
}
|
|
|
|
type StringIdentifierToIDPayload struct {
|
|
Identifier string `json:"identifier"`
|
|
ID uint `json:"id"`
|
|
}
|
|
|
|
type TranslatorService interface {
|
|
Translate(ctx context.Context, payloads []TranslatePayload) ([]TranslatePayload, error)
|
|
}
|