Documentation
¶
Index ¶
- Constants
- Variables
- func GetError(code int) error
- func GetStatusCode(err error) int
- func SetDefaultPermissions(instance Instance, permissions permV2Client.ResourcePermissions)
- type AuthAction
- type ContentVariable
- type ImportType
- type ImportTypeConfig
- type Instance
- type InstanceConfig
- type InstanceStatus
- type Instances
- type Type
Constants ¶
const ( String = models.String Integer = models.Integer Float = models.Float Boolean = models.Boolean List = models.List Structure = models.Structure )
const PermV2InstanceTopic = "import-instances"
Variables ¶
var ErrBadRequest = errors.New("bad request")
var ErrForbidden = fmt.Errorf("forbidden")
var ErrInternalServerError = errors.New("internal server error")
var ErrNotFound = fmt.Errorf("not found")
Functions ¶
func GetStatusCode ¶ added in v0.0.28
func SetDefaultPermissions ¶ added in v0.0.15
func SetDefaultPermissions(instance Instance, permissions permV2Client.ResourcePermissions)
Types ¶
type AuthAction ¶
type AuthAction string
const ( READ AuthAction = "r" WRITE AuthAction = "w" EXECUTE AuthAction = "x" ADMINISTRATE AuthAction = "a" )
func (AuthAction) String ¶
func (this AuthAction) String() string
type ContentVariable ¶ added in v0.2.1
type ContentVariable = models.ImportContentVariable
ContentVariable describes the output of an import type. It carries AspectIds; the deprecated AspectId is an alias for a single entry of that list. Both are filled by the import repository on read, so a reader here has to interpret only one of them and needs no folding of its own.
type ImportType ¶
type ImportType = models.ImportType
type ImportTypeConfig ¶
type ImportTypeConfig = models.ImportTypeConfig
ImportTypeConfig declares a config of an import type. It is the counterpart of InstanceConfig, which holds the value an instance actually runs with.
type Instance ¶
type Instance struct {
Id string `json:"id"`
Name string `json:"name"`
ImportTypeId string `json:"import_type_id"`
Image string `json:"image"`
KafkaTopic string `json:"kafka_topic"`
Configs []InstanceConfig `json:"configs"`
Restart *bool `json:"restart"`
ServiceId string `json:"-"`
Owner string `json:"-"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Generated bool `json:"generated"`
// Status is filled from the deployment backend on read and is never persisted.
Status *InstanceStatus `json:"status,omitempty" bson:"-"`
// Baggage is the OpenTelemetry context of the caller that created this instance.
// It is set from the request rather than from the payload -- a value sent in the
// body is ignored -- and handed to the container as pod labels and as the BAGGAGE
// environment variable, so that every log line about this import can be traced
// back to that context.
Baggage map[string]string `json:"baggage,omitempty"`
}
Instance is an import instance. Its api representation is the shared models.Import, widened by what this service keeps about a deployment. It is not aliased onto that type: the extra fields would have to be embedded, and an embedded type is no longer addressable by a field literal, which is how callers of this service's client build an instance.
type InstanceConfig ¶
type InstanceStatus ¶ added in v0.1.0
type InstanceStatus struct {
Running bool `json:"running"`
Transitioning bool `json:"transitioning"`
Message string `json:"message,omitempty"`
}
InstanceStatus describes the current state of the container running an instance.