Documentation ¶
Index ¶
- type Endpoint
- func (ep *Endpoint) AllJobs() ([]*v1alpha1.Trace, error)
- func (ep *Endpoint) CompletedJobs() ([]*v1alpha1.Trace, error)
- func (ep *Endpoint) CreateTrace(ctx context.Context, id, ns string, spec *v1alpha1.TraceSpec) (*v1alpha1.Trace, error)
- func (ep *Endpoint) DeleteTraceJob(ctx context.Context, id string) error
- func (ep *Endpoint) ReadTrace(ctx context.Context, ns, pod, container string, ch chan *StreamMessage) error
- func (ep *Endpoint) ReadTraceJob(ctx context.Context, id string, ch chan *StreamMessage) error
- func (ep *Endpoint) RunningJobs() ([]*v1alpha1.Trace, error)
- func (ep *Endpoint) URL(path string, wsock bool) *url.URL
- type StreamMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
Endpoint is all the information needed to connect and communicate with a swoll-server probe.
func NewEndpoint ¶
NewEndpoint creates a new endpoint context for creating, reading, and modifying jobs.
func (*Endpoint) AllJobs ¶
AllJobs returns a list of all running and completed jobs as one big array
func (*Endpoint) CompletedJobs ¶
CompletedJobs returns a list of completed jobs on the endpoint
func (*Endpoint) CreateTrace ¶
func (ep *Endpoint) CreateTrace(ctx context.Context, id, ns string, spec *v1alpha1.TraceSpec) (*v1alpha1.Trace, error)
CreateTrace will attempt to create a job of `spec` format. If the `id` is specified, it will use this string to denote the identity of the job and not a randomly-generated one.
func (*Endpoint) DeleteTraceJob ¶
DeleteTraceJob will delete the job `id` from the running jobs list
func (*Endpoint) ReadTrace ¶
func (ep *Endpoint) ReadTrace(ctx context.Context, ns, pod, container string, ch chan *StreamMessage) error
ReadTrace will connect to an already-running job, but allows a user to specify which specific parts to view. For example, if a currently-running job "app=nginx" matches the NS "swoll", POD "pod-A" and the container "container-B", then this can be called ReadTrace(ctx, "swoll", "pod-A", "container-B", ....) to obtain a subset of the stream.
func (*Endpoint) ReadTraceJob ¶
ReadTraceJob will read events from the output of a job
func (*Endpoint) RunningJobs ¶
RunningJobs will return a list of running jobs on the endpoint.
type StreamMessage ¶
type StreamMessage struct { Ep *Endpoint `json:"endpoint"` Data *event.TraceEvent `json:"payload"` }
StreamMessage will pack a TraceEvent along with the originating Endpoint so we can correlate where events were sourced.