EncodeString works similarly as Encode but payloads are specified as strings.
(payloads ...string)
| 107 | |
| 108 | // EncodeString works similarly as Encode but payloads are specified as strings. |
| 109 | func (e *Encoder) EncodeString(payloads ...string) error { |
| 110 | for _, p := range payloads { |
| 111 | if err := e.Encode([]byte(p)); err != nil { |
| 112 | return err |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | return nil |
| 117 | } |
| 118 | |
| 119 | // Encodef encodes a single pkt-line with the payload formatted as |
| 120 | // the format specifier. The rest of the arguments will be used in |