MCPcopy Create free account
hub / github.com/crewjam/saml / Deflate

Method Deflate

schema.go:157–178  ·  view source on GitHub ↗

Deflate returns a compressed byte array of the LogoutRequest

()

Source from the content-addressed store, hash-verified

155
156// Deflate returns a compressed byte array of the LogoutRequest
157func (r *LogoutRequest) Deflate() ([]byte, error) {
158 buf, err := r.Bytes()
159 if err != nil {
160 return nil, err
161 }
162
163 var b bytes.Buffer
164 writer, err := flate.NewWriter(&b, flate.DefaultCompression)
165 if err != nil {
166 return nil, err
167 }
168
169 if _, err := writer.Write(buf); err != nil {
170 return nil, err
171 }
172
173 if err := writer.Close(); err != nil {
174 return nil, err
175 }
176
177 return b.Bytes(), nil
178}
179
180// Element returns an etree.Element representing the object in XML form.
181func (r *AuthnRequest) Element() *etree.Element {

Callers

nothing calls this directly

Calls 2

BytesMethod · 0.95
CloseMethod · 0.80

Tested by

no test coverage detected