Documentation
¶
Overview ¶
Package wire converts between the SPECTRE service protocol and the domain model, so only the server's API boundary handles protocol messages.
Index ¶
- func DivergenceFromMessage(message *pb.Divergence) (model.Divergence, error)
- func DivergenceMessage(divergence model.Divergence) *pb.Divergence
- func FilterFromMessage(request *pb.ListDivergencesRequest) model.DivergenceFilter
- func FilterMessage(filter model.DivergenceFilter) *pb.ListDivergencesRequest
- func ListFromResponse(response *pb.ListDivergencesResponse) ([]model.State, []model.Divergence, error)
- func ListJSON(states []model.State, divergences []model.Divergence) ([]byte, error)
- func ListResponse(states []model.State, divergences []model.Divergence) *pb.ListDivergencesResponse
- func QuarantineFromMessage(message *pb.Quarantine) (model.Direction, model.Quarantine, error)
- func QuarantineMessage(direction model.Direction, status model.Quarantine) *pb.Quarantine
- func StateFromMessage(message *pb.State) (model.State, error)
- func StateMessage(state model.State) *pb.State
- func UpdateFromMessage(message *pb.UpdateRequest) (model.Update, error)
- func UpdateMessage(update model.Update) *pb.UpdateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DivergenceFromMessage ¶
func DivergenceFromMessage(message *pb.Divergence) (model.Divergence, error)
DivergenceFromMessage restores a listed divergence, checking that it identifies its mirror and direction.
func DivergenceMessage ¶
func DivergenceMessage(divergence model.Divergence) *pb.Divergence
DivergenceMessage returns the message that reports divergence.
func FilterFromMessage ¶
func FilterFromMessage(request *pb.ListDivergencesRequest) model.DivergenceFilter
FilterFromMessage restores the filter of a list request.
func FilterMessage ¶
func FilterMessage(filter model.DivergenceFilter) *pb.ListDivergencesRequest
FilterMessage returns the request that lists what filter selects.
func ListFromResponse ¶ added in v0.47.0
func ListFromResponse(response *pb.ListDivergencesResponse) ([]model.State, []model.Divergence, error)
ListFromResponse restores the states and divergences of a list response.
func ListJSON ¶ added in v0.47.0
ListJSON returns states and divergences as the protocol's JSON list response, which is what the command line prints.
func ListResponse ¶ added in v0.47.0
func ListResponse(states []model.State, divergences []model.Divergence) *pb.ListDivergencesResponse
ListResponse returns the protocol's list response for states and divergences.
func QuarantineFromMessage ¶ added in v0.48.0
func QuarantineFromMessage(message *pb.Quarantine) (model.Direction, model.Quarantine, error)
QuarantineFromMessage restores a reported quarantine and the direction of the proxy that holds it.
func QuarantineMessage ¶ added in v0.48.0
func QuarantineMessage(direction model.Direction, status model.Quarantine) *pb.Quarantine
QuarantineMessage returns the message that reports the quarantine of the proxy in direction.
func StateFromMessage ¶ added in v0.47.0
StateFromMessage restores a reported state, checking that it identifies its mirror and holds at most one quarantine per direction.
func StateMessage ¶ added in v0.47.0
StateMessage returns the message that reports state.
func UpdateFromMessage ¶ added in v0.48.0
func UpdateFromMessage(message *pb.UpdateRequest) (model.Update, error)
UpdateFromMessage restores a streamed update. A keepalive holds none.
func UpdateMessage ¶ added in v0.48.0
func UpdateMessage(update model.Update) *pb.UpdateRequest
UpdateMessage returns the message that streams update.
Types ¶
This section is empty.