diff options
author | Wim <wim@42.be> | 2016-09-18 19:21:15 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2016-09-18 19:21:15 +0200 |
commit | 7baf386edea4c71919b257d99ca7f7e07897c412 (patch) | |
tree | 5a6f7f0f506c3ab2d15d91548b1d0479bb8fb1ba /vendor/gopkg.in/gcfg.v1/token/serialize.go | |
parent | 6e410b096ef15e976f6a2d28f3412fe9e457f95a (diff) | |
download | matterbridge-msglm-7baf386edea4c71919b257d99ca7f7e07897c412.tar.gz matterbridge-msglm-7baf386edea4c71919b257d99ca7f7e07897c412.tar.bz2 matterbridge-msglm-7baf386edea4c71919b257d99ca7f7e07897c412.zip |
Refactor for more flexibility
* Move from gcfg to toml configuration because gcfg was too restrictive
* Implemented gateway which has support multiple in and out bridges.
* Allow for bridging the same bridges, which means eg you can now bridge between multiple mattermosts.
* Support multiple gateways
Diffstat (limited to 'vendor/gopkg.in/gcfg.v1/token/serialize.go')
-rw-r--r-- | vendor/gopkg.in/gcfg.v1/token/serialize.go | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/vendor/gopkg.in/gcfg.v1/token/serialize.go b/vendor/gopkg.in/gcfg.v1/token/serialize.go deleted file mode 100644 index 4adc8f9e..00000000 --- a/vendor/gopkg.in/gcfg.v1/token/serialize.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package token - -type serializedFile struct { - // fields correspond 1:1 to fields with same (lower-case) name in File - Name string - Base int - Size int - Lines []int - Infos []lineInfo -} - -type serializedFileSet struct { - Base int - Files []serializedFile -} - -// Read calls decode to deserialize a file set into s; s must not be nil. -func (s *FileSet) Read(decode func(interface{}) error) error { - var ss serializedFileSet - if err := decode(&ss); err != nil { - return err - } - - s.mutex.Lock() - s.base = ss.Base - files := make([]*File, len(ss.Files)) - for i := 0; i < len(ss.Files); i++ { - f := &ss.Files[i] - files[i] = &File{s, f.Name, f.Base, f.Size, f.Lines, f.Infos} - } - s.files = files - s.last = nil - s.mutex.Unlock() - - return nil -} - -// Write calls encode to serialize the file set s. -func (s *FileSet) Write(encode func(interface{}) error) error { - var ss serializedFileSet - - s.mutex.Lock() - ss.Base = s.base - files := make([]serializedFile, len(s.files)) - for i, f := range s.files { - files[i] = serializedFile{f.name, f.base, f.size, f.lines, f.infos} - } - ss.Files = files - s.mutex.Unlock() - - return encode(ss) -} |