Documentation
¶
Index ¶
- Variables
- func ValidateOperationRequest(req OperationRequest) error
- type Broadcaster
- func (b *Broadcaster) Broadcast(msgType StreamMessageType, data string)
- func (b *Broadcaster) BroadcastComplete(success bool, exitCode int)
- func (b *Broadcaster) BroadcastError(errorMsg string)
- func (b *Broadcaster) IsCompleted() bool
- func (b *Broadcaster) IsStarted() bool
- func (b *Broadcaster) MarkStarted()
- func (b *Broadcaster) Subscribe(subscriberID string, writer io.Writer) error
- func (b *Broadcaster) Unsubscribe(subscriberID string)
- type BroadcasterProgressWriter
- func (w *BroadcasterProgressWriter) WriteError(message string)
- func (w *BroadcasterProgressWriter) WriteMessage(messageType, message string)
- func (w *BroadcasterProgressWriter) WriteProgress(message string)
- func (w *BroadcasterProgressWriter) WriteStderr(message string)
- func (w *BroadcasterProgressWriter) WriteStdout(message string)
- type CompleteMessage
- type Handler
- type Message
- type Operation
- type OperationRequest
- type OperationResponse
- type RegistryCredential
- type Service
- type StreamMessage
- type StreamMessageType
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidCommand = errors.New("invalid command") ErrInvalidOption = errors.New("invalid option") ErrInvalidServiceName = errors.New("invalid service name") ErrCommandInjection = errors.New("command injection detected") )
View Source
var Module = fx.Options( fx.Provide(NewServiceWithConfig), fx.Provide(NewHandler), )
Functions ¶
func ValidateOperationRequest ¶
func ValidateOperationRequest(req OperationRequest) error
Types ¶
type Broadcaster ¶
type Broadcaster struct {
// contains filtered or unexported fields
}
func NewBroadcaster ¶
func NewBroadcaster(operationID string) *Broadcaster
func (*Broadcaster) Broadcast ¶
func (b *Broadcaster) Broadcast(msgType StreamMessageType, data string)
func (*Broadcaster) BroadcastComplete ¶
func (b *Broadcaster) BroadcastComplete(success bool, exitCode int)
func (*Broadcaster) BroadcastError ¶
func (b *Broadcaster) BroadcastError(errorMsg string)
func (*Broadcaster) IsCompleted ¶
func (b *Broadcaster) IsCompleted() bool
func (*Broadcaster) IsStarted ¶
func (b *Broadcaster) IsStarted() bool
func (*Broadcaster) MarkStarted ¶
func (b *Broadcaster) MarkStarted()
func (*Broadcaster) Subscribe ¶
func (b *Broadcaster) Subscribe(subscriberID string, writer io.Writer) error
func (*Broadcaster) Unsubscribe ¶
func (b *Broadcaster) Unsubscribe(subscriberID string)
type BroadcasterProgressWriter ¶
type BroadcasterProgressWriter struct {
// contains filtered or unexported fields
}
func NewBroadcasterProgressWriter ¶
func NewBroadcasterProgressWriter(broadcaster *Broadcaster) *BroadcasterProgressWriter
func (*BroadcasterProgressWriter) WriteError ¶
func (w *BroadcasterProgressWriter) WriteError(message string)
func (*BroadcasterProgressWriter) WriteMessage ¶
func (w *BroadcasterProgressWriter) WriteMessage(messageType, message string)
func (*BroadcasterProgressWriter) WriteProgress ¶
func (w *BroadcasterProgressWriter) WriteProgress(message string)
func (*BroadcasterProgressWriter) WriteStderr ¶
func (w *BroadcasterProgressWriter) WriteStderr(message string)
func (*BroadcasterProgressWriter) WriteStdout ¶
func (w *BroadcasterProgressWriter) WriteStdout(message string)
type CompleteMessage ¶
type CompleteMessage struct {
Type StreamMessageType `json:"type"`
Success bool `json:"success"`
ExitCode int `json:"exitCode"`
}
type Operation ¶
type Operation struct {
ID string
StackName string
Request OperationRequest
StartTime time.Time
Status string
ExitCode *int
IsSelfOp bool
Broadcaster *Broadcaster
}
type OperationRequest ¶
type OperationRequest struct {
Command string `json:"command"`
Options []string `json:"options"`
Services []string `json:"services"`
RegistryCredentials []RegistryCredential `json:"registry_credentials,omitempty"`
}
type OperationResponse ¶
type OperationResponse struct {
OperationID string `json:"operationId"`
}
type RegistryCredential ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewServiceWithConfig ¶
func (*Service) GetOperation ¶
func (*Service) StartOperation ¶
type StreamMessage ¶
type StreamMessageType ¶
type StreamMessageType string
const ( StreamTypeStdout StreamMessageType = "stdout" StreamTypeStderr StreamMessageType = "stderr" StreamTypeProgress StreamMessageType = "progress" StreamTypeComplete StreamMessageType = "complete" StreamTypeError StreamMessageType = "error" )
type Subscriber ¶
Click to show internal directories.
Click to hide internal directories.