{"modulePath":"code.cloudfoundry.org/cli-sapi","version":"v6.1.1+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package spdy\n\nPackage spdy implements the SPDY protocol (currently SPDY/3), described in [http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3](http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3).\n\n## Constants\n\n```go\nconst (\n\tTypeSynStream    ControlFrameType = 0x0001\n\tTypeSynReply                      = 0x0002\n\tTypeRstStream                     = 0x0003\n\tTypeSettings                      = 0x0004\n\tTypePing                          = 0x0006\n\tTypeGoAway                        = 0x0007\n\tTypeHeaders                       = 0x0008\n\tTypeWindowUpdate                  = 0x0009\n)\n```\n\n```go\nconst (\n\tControlFlagFin                   ControlFlags = 0x01\n\tControlFlagUnidirectional                     = 0x02\n\tControlFlagSettingsClearSettings              = 0x01\n)\n```\n\n```go\nconst (\n\tUnlowercasedHeaderName     ErrorCode = \"header was not lowercased\"\n\tDuplicateHeaders                     = \"multiple headers with same name\"\n\tWrongCompressedPayloadSize           = \"compressed payload size was incorrect\"\n\tUnknownFrameType                     = \"unknown frame type\"\n\tInvalidControlFrame                  = \"invalid control frame\"\n\tInvalidDataFrame                     = \"invalid data frame\"\n\tInvalidHeaderPresent                 = \"frame contained invalid header\"\n\tZeroStreamId                         = \"stream id zero is disallowed\"\n)\n```\n\n```go\nconst MaxDataLength = 1\u003c\u003c24 - 1\n```\nMaxDataLength is the maximum number of bytes that can be stored in one frame.\n\n```go\nconst Version = 3\n```\nVersion is the protocol version number that this package implements.\n\n## Types\n\n```go\ntype ControlFlags uint8\n```\nControlFlags are the flags that can be set on a control frame.\n\n```go\ntype ControlFrameHeader struct {\n\tFlags ControlFlags\n\t// contains filtered or unexported fields\n}\n```\nControlFrameHeader contains all the fields in a control frame header, in its unpacked in-memory representation.\n\n```go\ntype ControlFrameType uint16\n```\nControlFrameType stores the type field in a control frame header.\n\n```go\ntype DataFlags uint8\n```\nDataFlags are the flags that can be set on a data frame.\n\n```go\nconst (\n\tDataFlagFin DataFlags = 0x01\n)\n```\n\n```go\ntype DataFrame struct {\n\t// Note, high bit is the \"Control\" bit. Should be 0 for data frames.\n\tStreamId StreamId\n\tFlags    DataFlags\n\tData     []byte // payload data of this frame\n}\n```\nDataFrame is the unpacked, in-memory representation of a DATA frame.\n\n```go\ntype Error struct {\n\tErr      ErrorCode\n\tStreamId StreamId\n}\n```\nError contains both the type of error and additional values. StreamId is 0 if Error is not associated with a stream.\n\n```go\nfunc (e *Error) Error() string\n```\n\n```go\ntype ErrorCode string\n```\nA SPDY specific error.\n\n```go\ntype Frame interface {\n\t// contains filtered or unexported methods\n}\n```\nFrame is a single SPDY frame in its unpacked in-memory representation. Use Framer to read and write it.\n\n```go\ntype Framer struct {\n\t// contains filtered or unexported fields\n}\n```\nFramer handles serializing/deserializing SPDY frames, including compressing/ decompressing payloads.\n\n```go\nfunc NewFramer(w io.Writer, r io.Reader) (*Framer, error)\n```\nNewFramer allocates a new Framer for a given SPDY connection, repesented by a io.Writer and io.Reader. Note that Framer will read and write individual fields from/to the Reader and Writer, so the caller should pass in an appropriately buffered implementation to optimize performance.\n\n```go\nfunc (f *Framer) ReadFrame() (Frame, error)\n```\nReadFrame reads SPDY encoded data and returns a decompressed Frame.\n\n```go\nfunc (f *Framer) WriteFrame(frame Frame) error\n```\nWriteFrame writes a frame.\n\n```go\ntype GoAwayFrame struct {\n\tCFHeader         ControlFrameHeader\n\tLastGoodStreamId StreamId // last stream id which was accepted by sender\n\tStatus           GoAwayStatus\n}\n```\nGoAwayFrame is the unpacked, in-memory representation of a GOAWAY frame.\n\n```go\ntype GoAwayStatus uint32\n```\nGoAwayStatus represents the status in a GoAwayFrame.\n\n```go\nconst (\n\tGoAwayOK GoAwayStatus = iota\n\tGoAwayProtocolError\n\tGoAwayInternalError\n)\n```\n\n```go\ntype HeadersFrame struct {\n\tCFHeader ControlFrameHeader\n\tStreamId StreamId\n\tHeaders  http.Header\n}\n```\nHeadersFrame is the unpacked, in-memory representation of a HEADERS frame.\n\n```go\ntype PingFrame struct {\n\tCFHeader ControlFrameHeader\n\tId       uint32 // unique id for this ping, from server is even, from client is odd.\n}\n```\nPingFrame is the unpacked, in-memory representation of a PING frame.\n\n```go\ntype RstStreamFrame struct {\n\tCFHeader ControlFrameHeader\n\tStreamId StreamId\n\tStatus   RstStreamStatus\n}\n```\nRstStreamFrame is the unpacked, in-memory representation of a RST\\_STREAM frame.\n\n```go\ntype RstStreamStatus uint32\n```\nRstStreamStatus represents the status that led to a RST\\_STREAM.\n\n```go\nconst (\n\tProtocolError RstStreamStatus = iota + 1\n\tInvalidStream\n\tRefusedStream\n\tUnsupportedVersion\n\tCancel\n\tInternalError\n\tFlowControlError\n\tStreamInUse\n\tStreamAlreadyClosed\n\tInvalidCredentials\n\tFrameTooLarge\n)\n```\n\n```go\ntype SettingsFlag uint8\n```\nSettingsFlag represents a flag in a SETTINGS frame.\n\n```go\nconst (\n\tFlagSettingsPersistValue SettingsFlag = 0x1\n\tFlagSettingsPersisted                 = 0x2\n)\n```\n\n```go\ntype SettingsFlagIdValue struct {\n\tFlag  SettingsFlag\n\tId    SettingsId\n\tValue uint32\n}\n```\nSettingsFlagIdValue is the unpacked, in-memory representation of the combined flag/id/value for a setting in a SETTINGS frame.\n\n```go\ntype SettingsFrame struct {\n\tCFHeader     ControlFrameHeader\n\tFlagIdValues []SettingsFlagIdValue\n}\n```\nSettingsFrame is the unpacked, in-memory representation of a SPDY SETTINGS frame.\n\n```go\ntype SettingsId uint32\n```\nSettingsFlag represents the id of an id/value pair in a SETTINGS frame.\n\n```go\nconst (\n\tSettingsUploadBandwidth SettingsId = iota + 1\n\tSettingsDownloadBandwidth\n\tSettingsRoundTripTime\n\tSettingsMaxConcurrentStreams\n\tSettingsCurrentCwnd\n\tSettingsDownloadRetransRate\n\tSettingsInitialWindowSize\n\tSettingsClientCretificateVectorSize\n)\n```\n\n```go\ntype StreamId uint32\n```\nStreamId represents a 31-bit value identifying the stream.\n\n```go\ntype SynReplyFrame struct {\n\tCFHeader ControlFrameHeader\n\tStreamId StreamId\n\tHeaders  http.Header\n}\n```\nSynReplyFrame is the unpacked, in-memory representation of a SYN\\_REPLY frame.\n\n```go\ntype SynStreamFrame struct {\n\tCFHeader             ControlFrameHeader\n\tStreamId             StreamId\n\tAssociatedToStreamId StreamId // stream id for a stream which this stream is associated to\n\tPriority             uint8    // priority of this frame (3-bit)\n\tSlot                 uint8    // index in the server's credential vector of the client certificate\n\tHeaders              http.Header\n}\n```\nSynStreamFrame is the unpacked, in-memory representation of a SYN\\_STREAM frame.\n\n```go\ntype WindowUpdateFrame struct {\n\tCFHeader        ControlFrameHeader\n\tStreamId        StreamId\n\tDeltaWindowSize uint32 // additional number of bytes to existing window size\n}\n```\nWindowUpdateFrame is the unpacked, in-memory representation of a WINDOW\\_UPDATE frame.\n\n","path":"code.cloudfoundry.org/cli-sapi/src/code.google.com/p/go.net/spdy","name":"spdy","synopsis":"Package spdy implements the SPDY protocol (currently SPDY/3), described in http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3.","isRedistributable":true}
