Documentation ¶
Index ¶
- Variables
- func NewCLILogger(verbosity int, w io.Writer) logging.Logger
- func NewCapturingEmitter() *capturingEmitter
- func NewCliEmitter(w io.Writer, log logging.Logger) *cliEmitter
- func NewDataEmitter(data EventData, emitter Emitter) *dataEmitter
- func NewLoggerWithSSE(verbosity int, emitter *SSEEmitter) logging.Logger
- func NewMockEmitter() *mockEmitter
- func NewNullEmitter() *nullEmitter
- type Emitter
- type ErrorCode
- type Event
- type EventData
- type EventType
- type MockSSEServer
- func (m *MockSSEServer) Close()
- func (m *MockSSEServer) CreateStream(id string) *sse.Stream
- func (m *MockSSEServer) Publish(id string, event *sse.Event)
- func (m *MockSSEServer) RemoveStream(id string)
- func (m *MockSSEServer) StreamExists(id string) bool
- func (m *MockSSEServer) TryPublish(id string, event *sse.Event) bool
- type Operation
- type Phase
- type SSEEmitter
- type SSEHandler
- type SSEServer
Constants ¶
This section is empty.
Variables ¶
View Source
var NoData = struct{}{}
Functions ¶
func NewCapturingEmitter ¶
func NewCapturingEmitter() *capturingEmitter
func NewDataEmitter ¶
func NewLoggerWithSSE ¶
func NewLoggerWithSSE(verbosity int, emitter *SSEEmitter) logging.Logger
func NewMockEmitter ¶
func NewMockEmitter() *mockEmitter
func NewNullEmitter ¶
func NewNullEmitter() *nullEmitter
Types ¶
type ErrorCode ¶
const ( NoError ErrorCode = "" AuthenticationFailedCode ErrorCode = "authFailedErr" // Couldn't authenticate to publishing server PermissionsCode ErrorCode = "permissionErr" // Server responded with 403 forbidden OperationTimedOutCode ErrorCode = "timeoutErr" // HTTP request to publishing server timed out ConnectionFailedCode ErrorCode = "connectionFailed" // Couldn't connect to Connect ServerErrorCode ErrorCode = "serverErr" // HTTP 5xx code from publishing server VanityURLNotAvailableCode ErrorCode = "vanityURLNotAvailableErr" // Vanity URL already in use DeploymentNotFoundCode ErrorCode = "deploymentNotFoundErr" // Could not find deployment to update AppModeNotModifiableCode ErrorCode = "appModeNotModifiableErr" // attempt to deploy to an existing deployment with a non-matching app mode // Server failed to deploy the bundle. // This will eventually need to become more specific // so we can give better guidance. DeploymentFailedCode ErrorCode = "deployFailed" )
type Event ¶
type Event struct { Time time.Time Type EventType Data EventData ErrCode ErrorCode // contains filtered or unexported fields }
func NewErrorEvent ¶
func NewErrorEvent(e types.EventableError) Event
type MockSSEServer ¶
func NewMockSSEServer ¶
func NewMockSSEServer() *MockSSEServer
func (*MockSSEServer) Close ¶
func (m *MockSSEServer) Close()
func (*MockSSEServer) CreateStream ¶
func (m *MockSSEServer) CreateStream(id string) *sse.Stream
func (*MockSSEServer) Publish ¶
func (m *MockSSEServer) Publish(id string, event *sse.Event)
func (*MockSSEServer) RemoveStream ¶
func (m *MockSSEServer) RemoveStream(id string)
func (*MockSSEServer) StreamExists ¶
func (m *MockSSEServer) StreamExists(id string) bool
func (*MockSSEServer) TryPublish ¶
func (m *MockSSEServer) TryPublish(id string, event *sse.Event) bool
type Operation ¶
We use Operation and Phase to construct the event Type.
const ( AgentOp Operation = "agent" PublishCheckCapabilitiesOp Operation = "publish/checkCapabilities" PublishGetRPackageDescriptionsOp Operation = "publish/getRPackageDescriptions" PublishCreateNewDeploymentOp Operation = "publish/createNewDeployment" PublishSetEnvVarsOp Operation = "publish/setEnvVars" PublishCreateBundleOp Operation = "publish/createBundle" PublishUpdateDeploymentOp Operation = "publish/createDeployment" PublishUploadBundleOp Operation = "publish/uploadBundle" PublishDeployBundleOp Operation = "publish/deployBundle" PublishRestorePythonEnvOp Operation = "publish/restorePythonEnv" PublishRestoreREnvOp Operation = "publish/restoreREnv" PublishRunContentOp Operation = "publish/runContent" PublishSetVanityUrlOp Operation = "publish/setVanityURL" PublishValidateDeploymentOp Operation = "publish/validateDeployment" PublishOp Operation = "publish" )
type SSEEmitter ¶
type SSEEmitter struct {
// contains filtered or unexported fields
}
func NewSSEEmitter ¶
func NewSSEEmitter(server SSEServer) *SSEEmitter
func (*SSEEmitter) Emit ¶
func (e *SSEEmitter) Emit(event *Event) error
type SSEHandler ¶
type SSEHandler struct {
// contains filtered or unexported fields
}
SSEHandler emits an event for every log message.
func NewSSEHandler ¶
func NewSSEHandler(emitter *SSEEmitter) *SSEHandler
Click to show internal directories.
Click to hide internal directories.