fleet/server/fleet/translator.go
Tomas Touceda 484c6153e3
Issue 1359 fleetctl team transfer (#1413)
* 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>
2021-07-21 14:03:10 -03:00

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)
}