opaquedata

package
v0.0.0-...-ddc1a4a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StartPulsed represents a startJobUpdate request with a non-zero
	// blockIfNoPulsesAfterMs.
	StartPulsed UpdateAction = "start_pulsed"

	// Pulse represents a pulseJobUpdate request.
	Pulse = "pulse"

	// Rollback represents a rollbackJobUpdate request.
	Rollback = "rollback"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	UpdateID              string          `json:"update_id,omitempty"`
	UpdateActions         []UpdateAction  `json:"update_actions,omitempty"`
	UpdateMetadata        []*api.Metadata `json:"update_metadata,omitempty"`
	StartJobUpdateMessage string          `json:"start_job_update_msg,omitempty"`
}

Data is used to annotate Peloton updates with information that does not directly map into the Peloton API. It has no meaning in Peloton, however can be used when converting Peloton objects into Aurora objects to reconstruct Aurora states which do not exist in Peloton.

func Deserialize

func Deserialize(od *peloton.OpaqueData) (*Data, error)

Deserialize deserializes od into a Data struct. If od is empty, an empty Data struct is returned.

func NewDataFromJobUpdateRequest

func NewDataFromJobUpdateRequest(
	request *api.JobUpdateRequest,
	message *string,
) *Data

NewDataFromJobUpdateRequest creates opaquedata.Data from aurora JobUpdateRequest

func (*Data) AppendUpdateAction

func (d *Data) AppendUpdateAction(a UpdateAction)

AppendUpdateAction appends a to d's update actions.

func (*Data) ContainsUpdateAction

func (d *Data) ContainsUpdateAction(a UpdateAction) bool

ContainsUpdateAction returns true if d contains a.

func (*Data) IsLatestUpdateAction

func (d *Data) IsLatestUpdateAction(a UpdateAction) bool

IsLatestUpdateAction returns true if a is the latest UpdateAction in d.

func (*Data) Serialize

func (d *Data) Serialize() (*peloton.OpaqueData, error)

Serialize converts d into OpaqueData. Produces stable results.

type UpdateAction

type UpdateAction string

UpdateAction is an Aurora update action which has no equivalent in Peloton.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL