summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/yaml.v3/writerc.go
diff options
context:
space:
mode:
authorGary Kim <gary@garykim.dev>2020-08-30 07:49:26 -0400
committerGitHub <noreply@github.com>2020-08-30 13:49:26 +0200
commita0741d99b80d7da1c063853382756b3a9689f6a7 (patch)
tree86b6954d34558fe3a753284dea52928a031edc7a /vendor/gopkg.in/yaml.v3/writerc.go
parentc63f08c8113598149f312bffd3fbdf1970660639 (diff)
downloadmatterbridge-msglm-a0741d99b80d7da1c063853382756b3a9689f6a7.tar.gz
matterbridge-msglm-a0741d99b80d7da1c063853382756b3a9689f6a7.tar.bz2
matterbridge-msglm-a0741d99b80d7da1c063853382756b3a9689f6a7.zip
Add TLSConfig to nctalk (#1195)
Signed-off-by: Gary Kim <gary@garykim.dev>
Diffstat (limited to 'vendor/gopkg.in/yaml.v3/writerc.go')
-rw-r--r--vendor/gopkg.in/yaml.v3/writerc.go48
1 files changed, 48 insertions, 0 deletions
diff --git a/vendor/gopkg.in/yaml.v3/writerc.go b/vendor/gopkg.in/yaml.v3/writerc.go
new file mode 100644
index 00000000..b8a116bf
--- /dev/null
+++ b/vendor/gopkg.in/yaml.v3/writerc.go
@@ -0,0 +1,48 @@
+//
+// Copyright (c) 2011-2019 Canonical Ltd
+// Copyright (c) 2006-2010 Kirill Simonov
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy of
+// this software and associated documentation files (the "Software"), to deal in
+// the Software without restriction, including without limitation the rights to
+// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+// of the Software, and to permit persons to whom the Software is furnished to do
+// so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+package yaml
+
+// Set the writer error and return false.
+func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool {
+ emitter.error = yaml_WRITER_ERROR
+ emitter.problem = problem
+ return false
+}
+
+// Flush the output buffer.
+func yaml_emitter_flush(emitter *yaml_emitter_t) bool {
+ if emitter.write_handler == nil {
+ panic("write handler not set")
+ }
+
+ // Check if the buffer is empty.
+ if emitter.buffer_pos == 0 {
+ return true
+ }
+
+ if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil {
+ return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error())
+ }
+ emitter.buffer_pos = 0
+ return true
+}