Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildNotifier ¶
type BuildQueuedPayload ¶
type BuildRequestPayload ¶
type BuildRequestPayload struct {
BuildSpecYAML string `json:"build_spec_yaml"`
}
type BuildStatusPayload ¶
type BuildStatusPayload struct {
BuildID string `json:"build_id"`
Status string `json:"status"` // e.g., "queued", "fetching", "building", "success", "failure"
Message string `json:"message,omitempty"` // additional Message (e.g., failure reason)
ArtifactRef string `json:"artifact_ref,omitempty"` // The ref of the actual completed build (URL, path B2, tag Docker, etc.)
DurationSec *float64 `json:"duration_sec,omitempty"`
}
The actual build status.
type BuildTriggerer ¶
type Client ¶
type Client struct {
// Incoming messages are pushed here by the readPump.
// Users can read from this channel to process incoming messages.
Incoming chan *Message // Public channel for incoming messages
// contains filtered or unexported fields
}
func (*Client) Close ¶
func (c *Client) Close()
Close the websocket connection and stopping the client.
func (*Client) IsConnected ¶
type ErrorPayload ¶
type EventType ¶
type EventType string
const ( // Client -> Server EvtBuildRequest EventType = "build_request" // Build request EvtSecretRequest EventType = "secret_request" // Secret fetching request // Server -> Client EvtBuildQueued EventType = "build_queued" // Queued build response message EvtLogChunk EventType = "log_chunk" // A build part log result EvtBuildStatus EventType = "build_status" // Updating the build status (running, success, failure) EvtSecretResponse EventType = "secret_response" // Secret request response EvtError EventType = "error" // A standard error message for any event EvtPing EventType = "ping" EvtPong EventType = "pong" )
type LogChunkPayload ¶
type LogChunkPayload struct {
BuildID string `json:"build_id"`
Stream string `json:"stream"` // "stdout" or "stderr" (or "system")
Content string `json:"content"`
}
The log message chunk.
type Message ¶
type Message struct {
Type EventType `json:"type"` // The event type (needed)
RequestID string `json:"request_id,omitempty"`
Payload json.RawMessage `json:"payload,omitempty"` // Event specific data (raw JSON)
Error string `json:"error,omitempty"` // Event message if Type=EvtError or for negative error message
}
func NewErrorMessage ¶
func NewMessage ¶
func (*Message) AddPayload ¶
func (*Message) DecodePayload ¶
type SecretFetcher ¶
type SecretRequestPayload ¶
type SecretRequestPayload struct {
Source string `json:"source"`
}
type SecretResponsePayload ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(buildSvc BuildTriggerer, secretF SecretFetcher, originChecker func(r *http.Request) bool) *Server
Creating a new Websocket server and upgrading connection
Click to show internal directories.
Click to hide internal directories.