Documentation ¶
Index ¶
Constants ¶
const ( // These are unversioned, existed pre-AsyncAPI specification AssertionGetSubject = "snapd.v2.assertions.get" SnapsGetSubject = "snapd.v2.snaps.get" AppsPostSubject = "snapd.v2.apps.post" // These are versioned and exist in the AsyncAPI specification AssertionGetSubjectv1 = "v1.snapd.v2.assertions.get" SnapsGetSubjectv1 = "v1.snapd.v2.snaps.get" SnapsSnapPostSubjectv1 = "v1.snapd.v2.snaps.*.post" AppsPostSubjectv1 = "v1.snapd.v2.apps.post" IotAgentMqttBrokerConnected = "iot.agent.mqtt.connection.status" IotAgentMqttBrokerCurrentConnectedStatus = "iot.agent.mqtt.connection.status.current" )
const ( SnapdAPIUsername = "snapd1" LegacySnapdAPIUsername = "snapd" LegacySnapdAPIDefaultPassword = "accept solve carbon atmosphere" PublishDeny = "snapd.>" SubscribeDeny = "snapd.>" Publish = ">" Subscribe = ">" )
Variables ¶
var SnapdAPIDefaultPassword string
SnapdAPIDefaultPassword is a password that is provided by CI.
Functions ¶
This section is empty.
Types ¶
type AppsRequest ¶
AppsRequest is the message to act on snaps or their services Reference: https://snapcraft.io/docs/snapd-api#heading--apps
type AppsResponse ¶
type AppsResponse struct { ChangeID string `json:"changeId"` Error *string `json:"error,omitempty"` }
AppsResponse is the response to an AppsRequest, contains the change ID or an error message
type AssertionsRequest ¶
type AssertionsRequest struct {
Type string `json:"type"`
}
AssertionsRequest is the request for an assertions stream based on the type specified. Reference: https://snapcraft.io/docs/snapd-api#heading--assertions for types
type AssertionsResponse ¶
type AssertionsResponse struct {
Stream string `json:"stream"`
}
AssertionsResponse is a response containing the assertions based on the type requested as specified in the AssertionsRequest. It will be a stream of assertions, each stream is potentially multiple assertions. The are separated by double new lines. Reference: https://snapcraft.io/docs/snapd-api#heading--assertions
type NATSServer ¶
type NATSServer interface { PublishConnectionStatus(status bool) error SetLegacy(face legacy.HandlerIFace) }
type NatsConnInterface ¶
type Server ¶
type Server struct { LegacyInterface legacy.HandlerIFace // contains filtered or unexported fields }
func New ¶
func New(connected chan<- struct{}, conn NatsConnInterface) *Server
func (*Server) PublishConnectionStatus ¶
func (*Server) SetLegacy ¶
func (s *Server) SetLegacy(face legacy.HandlerIFace)
type SnapsResponse ¶
SnapsResponse is the response for getting a list of snaps. A request is made with the empty message. Reference: https://snapcraft.io/docs/snapd-api#heading--snaps