Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrLinkTargetPermissionDenied = errors.New("permission denied for reading link target")
)
var ErrRegexMatching = errors.New("could not match content length")
Functions ¶
This section is empty.
Types ¶
type ContentLengthWriter ¶
type ContentLengthWriter struct { Target http.ResponseWriter // contains filtered or unexported fields }
ContentLengthWriter implements io.Writer. It parses the size from the first line as Content Length Header and streams the following data to the Target. The first line is expected to follow the format headerLineRegex.
func (*ContentLengthWriter) SendMonitoringData ¶
func (w *ContentLengthWriter) SendMonitoringData(p *write.Point)
SendMonitoringData will send a monitoring event of the content length read and written.
type Ls2JsonWriter ¶
type Ls2JsonWriter struct { Target io.Writer //nolint:containedctx // See #630. Ctx context.Context // contains filtered or unexported fields }
Ls2JsonWriter implements io.Writer. It streams the passed data to the Target and transforms the data into the json format.
func (*Ls2JsonWriter) Close ¶
func (w *Ls2JsonWriter) Close() error
func (*Ls2JsonWriter) HasStartedWriting ¶
func (w *Ls2JsonWriter) HasStartedWriting() bool
type ReadWriter ¶
type ReadWriter struct {
Reader
}
ReadWriter implements io.ReadWriter. It does not return from Read and discards everything on Write.
type Reader ¶
Reader is a struct that implements the io.Reader interface. Read does not return when called until the context is done. It is used to avoid reading anything and returning io.EOF before the context has finished. For example the reader is used by the execution that fetches the stderr stream from Nomad. We do not have a stdin that we want to send to Nomad. But we still have to pass Nomad a reader. Normally readers send an io.EOF as soon as they have nothing more to read. But we want to avoid this, because in that case Nomad will abort (not the execution but) the transmission. Why should the reader not just always return 0, nil? Because Nomad reads in an endless loop and thus a busy waiting is avoided.