├── vendor ├── bazil.org │ └── fuse │ │ ├── fuse_kernel_std.go │ │ ├── fs │ │ ├── fstestutil │ │ │ ├── doc.go │ │ │ ├── mountinfo_freebsd.go │ │ │ ├── mountinfo.go │ │ │ ├── mountinfo_darwin.go │ │ │ ├── testfs.go │ │ │ ├── mountinfo_linux.go │ │ │ ├── debug.go │ │ │ └── checkdir.go │ │ └── tree.go │ │ ├── unmount.go │ │ ├── fuse_freebsd.go │ │ ├── error_freebsd.go │ │ ├── fuse_linux.go │ │ ├── error_darwin.go │ │ ├── error_linux.go │ │ ├── unmount_std.go │ │ ├── fuse_darwin.go │ │ ├── unmount_linux.go │ │ ├── options_linux.go │ │ ├── debug.go │ │ ├── options_freebsd.go │ │ ├── fuseutil │ │ └── fuseutil.go │ │ ├── README.md │ │ ├── options_darwin.go │ │ ├── buffer.go │ │ ├── mount.go │ │ ├── fuse_kernel_freebsd.go │ │ ├── error_std.go │ │ ├── fuse_kernel_linux.go │ │ ├── fuse_kernel_darwin.go │ │ └── protocol.go ├── gopkg.in │ └── vmihailenco │ │ └── msgpack.v2 │ │ ├── Makefile │ │ ├── msgpack.go │ │ ├── tags.go │ │ ├── time.go │ │ ├── LICENSE │ │ ├── appengine.go │ │ ├── codes │ │ └── codes.go │ │ ├── README.md │ │ └── encode_slice.go ├── github.com │ ├── boltdb │ │ └── bolt │ │ │ ├── boltsync_unix.go │ │ │ ├── bolt_linux.go │ │ │ ├── bolt_386.go │ │ │ ├── bolt_arm.go │ │ │ ├── bolt_amd64.go │ │ │ ├── bolt_ppc.go │ │ │ ├── bolt_arm64.go │ │ │ ├── bolt_ppc64.go │ │ │ ├── bolt_s390x.go │ │ │ ├── bolt_ppc64le.go │ │ │ ├── appveyor.yml │ │ │ ├── Makefile │ │ │ ├── bolt_openbsd.go │ │ │ ├── LICENSE │ │ │ ├── doc.go │ │ │ ├── bolt_unix_solaris.go │ │ │ ├── bolt_unix.go │ │ │ └── errors.go │ ├── op │ │ └── go-logging │ │ │ ├── CONTRIBUTORS │ │ │ ├── CHANGELOG.md │ │ │ ├── syslog_fallback.go │ │ │ ├── backend.go │ │ │ ├── LICENSE │ │ │ ├── syslog.go │ │ │ ├── multi.go │ │ │ └── log_nix.go │ ├── minio │ │ └── minio-go │ │ │ ├── MAINTAINERS.md │ │ │ ├── appveyor.yml │ │ │ ├── signature-type.go │ │ │ ├── CONTRIBUTING.md │ │ │ ├── tempfile.go │ │ │ ├── constants.go │ │ │ ├── s3-endpoints.go │ │ │ ├── api-put-object-copy.go │ │ │ ├── hook-reader.go │ │ │ ├── api-datatypes.go │ │ │ ├── api-get-policy.go │ │ │ └── copy-conditions.go │ └── golang │ │ └── protobuf │ │ ├── LICENSE │ │ └── proto │ │ └── Makefile ├── golang.org │ └── x │ │ ├── sys │ │ ├── unix │ │ │ ├── asm.s │ │ │ ├── constants.go │ │ │ ├── syscall_no_getwd.go │ │ │ ├── zsysnum_solaris_amd64.go │ │ │ ├── env_unset.go │ │ │ ├── flock_linux_32bit.go │ │ │ ├── asm_solaris_amd64.s │ │ │ ├── gccgo_linux_amd64.go │ │ │ ├── race0.go │ │ │ ├── env_unix.go │ │ │ ├── asm_linux_arm64.s │ │ │ ├── str.go │ │ │ ├── race.go │ │ │ ├── asm_linux_s390x.s │ │ │ ├── asm_linux_ppc64x.s │ │ │ ├── asm_linux_arm.s │ │ │ ├── asm_linux_mips64x.s │ │ │ ├── asm_freebsd_arm.s │ │ │ ├── asm_netbsd_arm.s │ │ │ ├── asm_darwin_386.s │ │ │ ├── asm_freebsd_386.s │ │ │ ├── asm_netbsd_386.s │ │ │ ├── asm_openbsd_386.s │ │ │ ├── asm_darwin_amd64.s │ │ │ ├── asm_freebsd_amd64.s │ │ │ ├── asm_linux_amd64.s │ │ │ ├── asm_netbsd_amd64.s │ │ │ ├── asm_openbsd_amd64.s │ │ │ ├── asm_dragonfly_amd64.s │ │ │ ├── asm_darwin_arm.s │ │ │ ├── bluetooth_linux.go │ │ │ ├── asm_darwin_arm64.s │ │ │ ├── flock.go │ │ │ ├── mksysnum_darwin.pl │ │ │ ├── asm_linux_386.s │ │ │ ├── syscall_solaris_amd64.go │ │ │ ├── syscall_openbsd_amd64.go │ │ │ ├── syscall_netbsd_386.go │ │ │ ├── syscall_netbsd_arm.go │ │ │ ├── syscall_netbsd_amd64.go │ │ │ ├── syscall_openbsd_386.go │ │ │ ├── gccgo_c.c │ │ │ ├── sockcmsg_linux.go │ │ │ ├── mksysnum_dragonfly.pl │ │ │ ├── mksysnum_openbsd.pl │ │ │ ├── mksysnum_netbsd.pl │ │ │ ├── mksysnum_linux.pl │ │ │ ├── syscall_dragonfly_amd64.go │ │ │ ├── syscall_freebsd_amd64.go │ │ │ ├── syscall_freebsd_arm.go │ │ │ ├── syscall_freebsd_386.go │ │ │ ├── gccgo.go │ │ │ ├── mksysnum_freebsd.pl │ │ │ ├── mkpost.go │ │ │ ├── syscall_darwin_arm.go │ │ │ ├── syscall_darwin_arm64.go │ │ │ ├── syscall_darwin_386.go │ │ │ ├── syscall_darwin_amd64.go │ │ │ └── syscall.go │ │ ├── PATENTS │ │ └── LICENSE │ │ └── net │ │ ├── PATENTS │ │ └── LICENSE └── google.golang.org │ └── appengine │ ├── internal │ ├── main.go │ ├── identity.go │ ├── base │ │ └── api_base.proto │ ├── app_id.go │ ├── main_vm.go │ ├── remote_api │ │ └── remote_api.proto │ ├── identity_classic.go │ ├── regen.sh │ ├── net.go │ ├── metadata.go │ ├── app_identity │ │ └── app_identity_service.proto │ ├── modules │ │ └── modules_service.proto │ └── identity_vm.go │ ├── timeout.go │ ├── appengine_vm.go │ ├── namespace.go │ ├── errors.go │ └── datastore │ └── metadata.go ├── fs ├── dir.go ├── view.go ├── node.go ├── index_type.go ├── cluster.go ├── cat.go ├── nodes.go ├── index.go ├── root.go └── config.go ├── json ├── tags_test.go └── tags.go ├── elasticofs.go └── README.md /vendor/bazil.org/fuse/fuse_kernel_std.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/fs/fstestutil/doc.go: -------------------------------------------------------------------------------- 1 | package fstestutil // import "bazil.org/fuse/fs/fstestutil" 2 | -------------------------------------------------------------------------------- /vendor/gopkg.in/vmihailenco/msgpack.v2/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | go test ./... 3 | env GOOS=linux GOARCH=386 go test ./... 4 | go test ./... -short -race 5 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/unmount.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | 3 | // Unmount tries to unmount the filesystem mounted at dir. 4 | func Unmount(dir string) error { 5 | return unmount(dir) 6 | } 7 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/fuse_freebsd.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | 3 | // Maximum file write size we are prepared to receive from the kernel. 4 | // 5 | // This number is just a guess. 6 | const maxWrite = 128 * 1024 7 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/fs/fstestutil/mountinfo_freebsd.go: -------------------------------------------------------------------------------- 1 | package fstestutil 2 | 3 | import "errors" 4 | 5 | func getMountInfo(mnt string) (*MountInfo, error) { 6 | return nil, errors.New("FreeBSD has no useful mount information") 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/boltsync_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!plan9,!linux,!openbsd 2 | 3 | package bolt 4 | 5 | // fdatasync flushes written data to a file descriptor. 6 | func fdatasync(db *DB) error { 7 | return db.file.Sync() 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/op/go-logging/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Alec Thomas 2 | Guilhem Lettron 3 | Ivan Daniluk 4 | Nimi Wariboko Jr 5 | Róbert Selvek 6 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_linux.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fdatasync flushes written data to a file descriptor. 8 | func fdatasync(db *DB) error { 9 | return syscall.Fdatasync(int(db.file.Fd())) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/error_freebsd.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | 3 | import "syscall" 4 | 5 | const ( 6 | ENOATTR = Errno(syscall.ENOATTR) 7 | ) 8 | 9 | const ( 10 | errNoXattr = ENOATTR 11 | ) 12 | 13 | func init() { 14 | errnoNames[errNoXattr] = "ENOATTR" 15 | } 16 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/fuse_linux.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | 3 | // Maximum file write size we are prepared to receive from the kernel. 4 | // 5 | // Linux 4.2.0 has been observed to cap this value at 128kB 6 | // (FUSE_MAX_PAGES_PER_REQ=32, 4kB pages). 7 | const maxWrite = 128 * 1024 8 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_386.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | // maxMapSize represents the largest mmap size supported by Bolt. 4 | const maxMapSize = 0x7FFFFFFF // 2GB 5 | 6 | // maxAllocSize is the size used when creating array pointers. 7 | const maxAllocSize = 0xFFFFFFF 8 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_arm.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | // maxMapSize represents the largest mmap size supported by Bolt. 4 | const maxMapSize = 0x7FFFFFFF // 2GB 5 | 6 | // maxAllocSize is the size used when creating array pointers. 7 | const maxAllocSize = 0xFFFFFFF 8 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/error_darwin.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | const ( 8 | ENOATTR = Errno(syscall.ENOATTR) 9 | ) 10 | 11 | const ( 12 | errNoXattr = ENOATTR 13 | ) 14 | 15 | func init() { 16 | errnoNames[errNoXattr] = "ENOATTR" 17 | } 18 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/error_linux.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | const ( 8 | ENODATA = Errno(syscall.ENODATA) 9 | ) 10 | 11 | const ( 12 | errNoXattr = ENODATA 13 | ) 14 | 15 | func init() { 16 | errnoNames[errNoXattr] = "ENODATA" 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_amd64.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | // maxMapSize represents the largest mmap size supported by Bolt. 4 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 5 | 6 | // maxAllocSize is the size used when creating array pointers. 7 | const maxAllocSize = 0x7FFFFFFF 8 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_ppc.go: -------------------------------------------------------------------------------- 1 | // +build ppc 2 | 3 | package bolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0x7FFFFFFF // 2GB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0xFFFFFFF 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | TEXT ·use(SB),NOSPLIT,$0 10 | RET 11 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_arm64.go: -------------------------------------------------------------------------------- 1 | // +build arm64 2 | 3 | package bolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_ppc64.go: -------------------------------------------------------------------------------- 1 | // +build ppc64 2 | 3 | package bolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_s390x.go: -------------------------------------------------------------------------------- 1 | // +build s390x 2 | 3 | package bolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_ppc64le.go: -------------------------------------------------------------------------------- 1 | // +build ppc64le 2 | 3 | package bolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/unmount_std.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package fuse 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | ) 9 | 10 | func unmount(dir string) error { 11 | err := syscall.Unmount(dir, 0) 12 | if err != nil { 13 | err = &os.PathError{Op: "unmount", Path: dir, Err: err} 14 | return err 15 | } 16 | return nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | 3 | os: Windows Server 2012 R2 4 | 5 | clone_folder: c:\gopath\src\github.com\boltdb\bolt 6 | 7 | environment: 8 | GOPATH: c:\gopath 9 | 10 | install: 11 | - echo %PATH% 12 | - echo %GOPATH% 13 | - go version 14 | - go env 15 | - go get -v -t ./... 16 | 17 | build_script: 18 | - go test -v ./... 19 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package internal 8 | 9 | import ( 10 | "appengine_internal" 11 | ) 12 | 13 | func Main() { 14 | appengine_internal.Main() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_no_getwd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build dragonfly freebsd netbsd openbsd 6 | 7 | package unix 8 | 9 | const ImplementsGetwd = false 10 | 11 | func Getwd() (string, error) { return "", ENOTSUP } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsysnum_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | // TODO(aram): remove these before Go 1.3. 10 | const ( 11 | SYS_EXECVE = 59 12 | SYS_FCNTL = 62 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Unsetenv(key string) error { 12 | // This was added in Go 1.4. 13 | return syscall.Unsetenv(key) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/fuse_darwin.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | 3 | // Maximum file write size we are prepared to receive from the kernel. 4 | // 5 | // This value has to be >=16MB or OSXFUSE (3.4.0 observed) will 6 | // forcibly close the /dev/fuse file descriptor on a Setxattr with a 7 | // 16MB value. See TestSetxattr16MB and 8 | // https://github.com/bazil/fuse/issues/42 9 | const maxWrite = 16 * 1024 * 1024 10 | -------------------------------------------------------------------------------- /vendor/github.com/minio/minio-go/MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | # For maintainers only 2 | 3 | ## Responsibilities 4 | 5 | Please go through this link [Maintainer Responsibility](https://gist.github.com/abperiasamy/f4d9b31d3186bbd26522) 6 | 7 | ### Making new releases 8 | 9 | Edit `libraryVersion` constant in `api.go`. 10 | 11 | ``` 12 | $ grep libraryVersion api.go 13 | libraryVersion = "0.3.0" 14 | ``` 15 | 16 | ``` 17 | $ git tag 0.3.0 18 | $ git push --tags 19 | ``` -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/unmount_linux.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | 3 | import ( 4 | "bytes" 5 | "errors" 6 | "os/exec" 7 | ) 8 | 9 | func unmount(dir string) error { 10 | cmd := exec.Command("fusermount", "-u", dir) 11 | output, err := cmd.CombinedOutput() 12 | if err != nil { 13 | if len(output) > 0 { 14 | output = bytes.TrimRight(output, "\n") 15 | msg := err.Error() + ": " + string(output) 16 | err = errors.New(msg) 17 | } 18 | return err 19 | } 20 | return nil 21 | } 22 | -------------------------------------------------------------------------------- /vendor/gopkg.in/vmihailenco/msgpack.v2/msgpack.go: -------------------------------------------------------------------------------- 1 | package msgpack // import "gopkg.in/vmihailenco/msgpack.v2" 2 | 3 | // Deprecated. Use CustomEncoder. 4 | type Marshaler interface { 5 | MarshalMsgpack() ([]byte, error) 6 | } 7 | 8 | // Deprecated. Use CustomDecoder. 9 | type Unmarshaler interface { 10 | UnmarshalMsgpack([]byte) error 11 | } 12 | 13 | type CustomEncoder interface { 14 | EncodeMsgpack(*Encoder) error 15 | } 16 | 17 | type CustomDecoder interface { 18 | DecodeMsgpack(*Decoder) error 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/Makefile: -------------------------------------------------------------------------------- 1 | BRANCH=`git rev-parse --abbrev-ref HEAD` 2 | COMMIT=`git rev-parse --short HEAD` 3 | GOLDFLAGS="-X main.branch $(BRANCH) -X main.commit $(COMMIT)" 4 | 5 | default: build 6 | 7 | race: 8 | @go test -v -race -test.run="TestSimulate_(100op|1000op)" 9 | 10 | # go get github.com/kisielk/errcheck 11 | errcheck: 12 | @errcheck -ignorepkg=bytes -ignore=os:Remove github.com/boltdb/bolt 13 | 14 | test: 15 | @go test -v -cover . 16 | @go test -v ./cmd/bolt 17 | 18 | .PHONY: fmt test 19 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/options_linux.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | 3 | func localVolume(conf *mountConfig) error { 4 | return nil 5 | } 6 | 7 | func volumeName(name string) MountOption { 8 | return dummyOption 9 | } 10 | 11 | func daemonTimeout(name string) MountOption { 12 | return dummyOption 13 | } 14 | 15 | func noAppleXattr(conf *mountConfig) error { 16 | return nil 17 | } 18 | 19 | func noAppleDouble(conf *mountConfig) error { 20 | return nil 21 | } 22 | 23 | func exclCreate(conf *mountConfig) error { 24 | return nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-64 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-64 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/identity.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import netcontext "golang.org/x/net/context" 8 | 9 | // These functions are implementations of the wrapper functions 10 | // in ../appengine/identity.go. See that file for commentary. 11 | 12 | func AppID(c netcontext.Context) string { 13 | return appID(FullyQualifiedAppID(c)) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /fs/dir.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import ( 4 | "os" 5 | "path" 6 | 7 | "golang.org/x/net/context" 8 | 9 | "bazil.org/fuse" 10 | ) 11 | 12 | type Dir struct { 13 | Path string 14 | Inode uint64 15 | mfs *ElasticoFS 16 | } 17 | 18 | func (dir *Dir) Dirent() fuse.Dirent { 19 | return fuse.Dirent{ 20 | Inode: dir.Inode, Name: path.Base(dir.Path), Type: fuse.DT_Dir, 21 | } 22 | } 23 | 24 | func (dir *Dir) Attr(ctx context.Context, a *fuse.Attr) error { 25 | *a = fuse.Attr{ 26 | Mode: os.ModeDir | dir.mfs.config.mode | 0110, 27 | } 28 | return nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/debug.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | 3 | import ( 4 | "runtime" 5 | ) 6 | 7 | func stack() string { 8 | buf := make([]byte, 1024) 9 | return string(buf[:runtime.Stack(buf, false)]) 10 | } 11 | 12 | func nop(msg interface{}) {} 13 | 14 | // Debug is called to output debug messages, including protocol 15 | // traces. The default behavior is to do nothing. 16 | // 17 | // The messages have human-friendly string representations and are 18 | // safe to marshal to JSON. 19 | // 20 | // Implementations must not retain msg. 21 | var Debug func(msg interface{}) = nop 22 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/timeout.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package appengine 6 | 7 | import "golang.org/x/net/context" 8 | 9 | // IsTimeoutError reports whether err is a timeout error. 10 | func IsTimeoutError(err error) bool { 11 | if err == context.DeadlineExceeded { 12 | return true 13 | } 14 | if t, ok := err.(interface { 15 | IsTimeout() bool 16 | }); ok { 17 | return t.IsTimeout() 18 | } 19 | return false 20 | } 21 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/options_freebsd.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | 3 | func localVolume(conf *mountConfig) error { 4 | return nil 5 | } 6 | 7 | func volumeName(name string) MountOption { 8 | return dummyOption 9 | } 10 | 11 | func daemonTimeout(name string) MountOption { 12 | return func(conf *mountConfig) error { 13 | conf.options["timeout"] = name 14 | return nil 15 | } 16 | } 17 | 18 | func noAppleXattr(conf *mountConfig) error { 19 | return nil 20 | } 21 | 22 | func noAppleDouble(conf *mountConfig) error { 23 | return nil 24 | } 25 | 26 | func exclCreate(conf *mountConfig) error { 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/fuseutil/fuseutil.go: -------------------------------------------------------------------------------- 1 | package fuseutil // import "bazil.org/fuse/fuseutil" 2 | 3 | import ( 4 | "bazil.org/fuse" 5 | ) 6 | 7 | // HandleRead handles a read request assuming that data is the entire file content. 8 | // It adjusts the amount returned in resp according to req.Offset and req.Size. 9 | func HandleRead(req *fuse.ReadRequest, resp *fuse.ReadResponse, data []byte) { 10 | if req.Offset >= int64(len(data)) { 11 | data = nil 12 | } else { 13 | data = data[req.Offset:] 14 | } 15 | if len(data) > req.Size { 16 | data = data[:req.Size] 17 | } 18 | n := copy(resp.Data[:req.Size], data) 19 | resp.Data = resp.Data[:n] 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_openbsd.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | const ( 9 | msAsync = 1 << iota // perform asynchronous writes 10 | msSync // perform synchronous writes 11 | msInvalidate // invalidate cached data 12 | ) 13 | 14 | func msync(db *DB) error { 15 | _, _, errno := syscall.Syscall(syscall.SYS_MSYNC, uintptr(unsafe.Pointer(db.data)), uintptr(db.datasz), msInvalidate) 16 | if errno != 0 { 17 | return errno 18 | } 19 | return nil 20 | } 21 | 22 | func fdatasync(db *DB) error { 23 | if db.data != nil { 24 | return msync(db) 25 | } 26 | return db.file.Sync() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/appengine_vm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | 7 | package appengine 8 | 9 | import ( 10 | "golang.org/x/net/context" 11 | 12 | "google.golang.org/appengine/internal" 13 | ) 14 | 15 | // BackgroundContext returns a context not associated with a request. 16 | // This should only be used when not servicing a request. 17 | // This only works in App Engine "flexible environment". 18 | func BackgroundContext() context.Context { 19 | return internal.BackgroundContext() 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | -------------------------------------------------------------------------------- /json/tags_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package json 6 | 7 | import ( 8 | "testing" 9 | ) 10 | 11 | func TestTagParsing(t *testing.T) { 12 | name, opts := parseTag("field,foobar,foo") 13 | if name != "field" { 14 | t.Fatalf("name = %q, want field", name) 15 | } 16 | for _, tt := range []struct { 17 | opt string 18 | want bool 19 | }{ 20 | {"foobar", true}, 21 | {"foo", true}, 22 | {"bar", false}, 23 | } { 24 | if opts.Contains(tt.opt) != tt.want { 25 | t.Errorf("Contains(%q) = %v", tt.opt, !tt.want) 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/base/api_base.proto: -------------------------------------------------------------------------------- 1 | // Built-in base types for API calls. Primarily useful as return types. 2 | 3 | syntax = "proto2"; 4 | option go_package = "base"; 5 | 6 | package appengine.base; 7 | 8 | message StringProto { 9 | required string value = 1; 10 | } 11 | 12 | message Integer32Proto { 13 | required int32 value = 1; 14 | } 15 | 16 | message Integer64Proto { 17 | required int64 value = 1; 18 | } 19 | 20 | message BoolProto { 21 | required bool value = 1; 22 | } 23 | 24 | message DoubleProto { 25 | required double value = 1; 26 | } 27 | 28 | message BytesProto { 29 | required bytes value = 1 [ctype=CORD]; 30 | } 31 | 32 | message VoidProto { 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | B syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | B syscall·RawSyscall6(SB) 25 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/README.md: -------------------------------------------------------------------------------- 1 | bazil.org/fuse -- Filesystems in Go 2 | =================================== 3 | 4 | `bazil.org/fuse` is a Go library for writing FUSE userspace 5 | filesystems. 6 | 7 | It is a from-scratch implementation of the kernel-userspace 8 | communication protocol, and does not use the C library from the 9 | project called FUSE. `bazil.org/fuse` embraces Go fully for safety and 10 | ease of programming. 11 | 12 | Here’s how to get going: 13 | 14 | go get bazil.org/fuse 15 | 16 | Website: http://bazil.org/fuse/ 17 | 18 | Github repository: https://github.com/bazil/fuse 19 | 20 | API docs: http://godoc.org/bazil.org/fuse 21 | 22 | Our thanks to Russ Cox for his fuse library, which this project is 23 | based on. 24 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/fs/fstestutil/mountinfo.go: -------------------------------------------------------------------------------- 1 | package fstestutil 2 | 3 | // MountInfo describes a mounted file system. 4 | type MountInfo struct { 5 | FSName string 6 | Type string 7 | } 8 | 9 | // GetMountInfo finds information about the mount at mnt. It is 10 | // intended for use by tests only, and only fetches information 11 | // relevant to the current tests. 12 | func GetMountInfo(mnt string) (*MountInfo, error) { 13 | return getMountInfo(mnt) 14 | } 15 | 16 | // cstr converts a nil-terminated C string into a Go string 17 | func cstr(ca []int8) string { 18 | s := make([]byte, 0, len(ca)) 19 | for _, c := range ca { 20 | if c == 0x00 { 21 | break 22 | } 23 | s = append(s, byte(c)) 24 | } 25 | return string(s) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /elasticofs.go: -------------------------------------------------------------------------------- 1 | /* 2 | * ElasticoFS 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package main 18 | 19 | import ( 20 | "github.com/dutchcoders/elasticofs/cmd" 21 | ) 22 | 23 | func main() { 24 | cmd.Main() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x 6 | // +build linux 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for s390x, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/github.com/op/go-logging/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 2.0.0-rc1 (2016-02-11) 4 | 5 | Time flies and it has been three years since this package was first released. 6 | There have been a couple of API changes I have wanted to do for some time but 7 | I've tried to maintain backwards compatibility. Some inconsistencies in the 8 | API have started to show, proper vendor support in Go out of the box and 9 | the fact that `go vet` will give warnings -- I have decided to bump the major 10 | version. 11 | 12 | * Make eg. `Info` and `Infof` do different things. You want to change all calls 13 | to `Info` with a string format go to `Infof` etc. In many cases, `go vet` will 14 | guide you. 15 | * `Id` in `Record` is now called `ID` 16 | 17 | ## 1.0.0 (2013-02-21) 18 | 19 | Initial release 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | B syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | B syscall·RawSyscall6(SB) 27 | 28 | TEXT ·seek(SB),NOSPLIT,$0-32 29 | B syscall·seek(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips64 mips64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | JMP syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | JMP syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 29 | JMP syscall·gettimeofday(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/app_id.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | func parseFullAppID(appid string) (partition, domain, displayID string) { 12 | if i := strings.Index(appid, "~"); i != -1 { 13 | partition, appid = appid[:i], appid[i+1:] 14 | } 15 | if i := strings.Index(appid, ":"); i != -1 { 16 | domain, appid = appid[:i], appid[i+1:] 17 | } 18 | return partition, domain, appid 19 | } 20 | 21 | // appID returns "appid" or "domain.com:appid". 22 | func appID(fullAppID string) string { 23 | _, dom, dis := parseFullAppID(fullAppID) 24 | if dom != "" { 25 | return dom + ":" + dis 26 | } 27 | return dis 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/options_darwin.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | 3 | func localVolume(conf *mountConfig) error { 4 | conf.options["local"] = "" 5 | return nil 6 | } 7 | 8 | func volumeName(name string) MountOption { 9 | return func(conf *mountConfig) error { 10 | conf.options["volname"] = name 11 | return nil 12 | } 13 | } 14 | 15 | func daemonTimeout(name string) MountOption { 16 | return func(conf *mountConfig) error { 17 | conf.options["daemon_timeout"] = name 18 | return nil 19 | } 20 | } 21 | 22 | func noAppleXattr(conf *mountConfig) error { 23 | conf.options["noapplexattr"] = "" 24 | return nil 25 | } 26 | 27 | func noAppleDouble(conf *mountConfig) error { 28 | conf.options["noappledouble"] = "" 29 | return nil 30 | } 31 | 32 | func exclCreate(conf *mountConfig) error { 33 | conf.options["excl_create"] = "" 34 | return nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/github.com/op/go-logging/syslog_fallback.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013, Örjan Persson. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //+build windows plan9 6 | 7 | package logging 8 | 9 | import ( 10 | "fmt" 11 | ) 12 | 13 | type Priority int 14 | 15 | type SyslogBackend struct { 16 | } 17 | 18 | func NewSyslogBackend(prefix string) (b *SyslogBackend, err error) { 19 | return nil, fmt.Errorf("Platform does not support syslog") 20 | } 21 | 22 | func NewSyslogBackendPriority(prefix string, priority Priority) (b *SyslogBackend, err error) { 23 | return nil, fmt.Errorf("Platform does not support syslog") 24 | } 25 | 26 | func (b *SyslogBackend) Log(level Level, calldepth int, rec *Record) error { 27 | return fmt.Errorf("Platform does not support syslog") 28 | } 29 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/fs/fstestutil/mountinfo_darwin.go: -------------------------------------------------------------------------------- 1 | package fstestutil 2 | 3 | import ( 4 | "regexp" 5 | "syscall" 6 | ) 7 | 8 | var re = regexp.MustCompile(`\\(.)`) 9 | 10 | // unescape removes backslash-escaping. The escaped characters are not 11 | // mapped in any way; that is, unescape(`\n` ) == `n`. 12 | func unescape(s string) string { 13 | return re.ReplaceAllString(s, `$1`) 14 | } 15 | 16 | func getMountInfo(mnt string) (*MountInfo, error) { 17 | var st syscall.Statfs_t 18 | err := syscall.Statfs(mnt, &st) 19 | if err != nil { 20 | return nil, err 21 | } 22 | i := &MountInfo{ 23 | // osx getmntent(3) fails to un-escape the data, so we do it.. 24 | // this might lead to double-unescaping in the future. fun. 25 | // TestMountOptionFSNameEvilBackslashDouble checks for that. 26 | FSName: unescape(cstr(st.Mntfromname[:])), 27 | } 28 | return i, nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin freebsd openbsd netbsd dragonfly 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build darwin dragonfly freebsd linux netbsd openbsd 8 | 9 | package unix 10 | 11 | import "unsafe" 12 | 13 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 14 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 15 | var fcntl64Syscall uintptr = SYS_FCNTL 16 | 17 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 18 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 19 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 20 | if errno == 0 { 21 | return nil 22 | } 23 | return errno 24 | } 25 | -------------------------------------------------------------------------------- /fs/view.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import ( 4 | "bytes" 5 | 6 | "bazil.org/fuse" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | type View struct { 11 | data []byte 12 | Path string 13 | mfs *ElasticoFS 14 | } 15 | 16 | func (s *View) Attr(ctx context.Context, a *fuse.Attr) error { 17 | s.load() 18 | *a = fuse.Attr{ 19 | Size: uint64(len(s.data)), 20 | Mode: s.mfs.config.mode, 21 | } 22 | 23 | return nil 24 | } 25 | 26 | func (s *View) ReadAll(ctx context.Context) ([]byte, error) { 27 | s.load() 28 | return s.data, nil 29 | } 30 | 31 | func (s *View) load() error { 32 | // todo(nl5887): once.Do() 33 | req, err := s.mfs.client.NewRequest("GET", s.Path, nil) 34 | if err != nil { 35 | return err 36 | } 37 | 38 | var resp bytes.Buffer 39 | if err := s.mfs.client.Do(req, &resp); err != nil { 40 | return err 41 | } 42 | 43 | s.data = resp.Bytes() 44 | return nil 45 | } 46 | -------------------------------------------------------------------------------- /fs/node.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import ( 4 | "path/filepath" 5 | 6 | "bazil.org/fuse" 7 | "bazil.org/fuse/fs" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | type Node struct { 12 | Dir 13 | } 14 | 15 | func (n *Node) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { 16 | var entries = []fuse.Dirent{} 17 | for k, _ := range n.Views() { 18 | entries = append(entries, fuse.Dirent{ 19 | Inode: 0, Name: k, Type: fuse.DT_File, 20 | }) 21 | } 22 | 23 | return entries, nil 24 | } 25 | 26 | func (n *Node) Lookup(ctx context.Context, name string) (fs.Node, error) { 27 | if p, ok := n.Views()[name]; ok { 28 | return &View{ 29 | mfs: n.mfs, 30 | Path: filepath.Join(n.Path, p), 31 | /*template*/ 32 | }, nil 33 | } 34 | 35 | return nil, fuse.ENOENT 36 | } 37 | 38 | func (d *Node) Views() map[string]string { 39 | return map[string]string{ 40 | "stats": "stats", 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/namespace.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package appengine 6 | 7 | import ( 8 | "fmt" 9 | "regexp" 10 | 11 | "golang.org/x/net/context" 12 | 13 | "google.golang.org/appengine/internal" 14 | ) 15 | 16 | // Namespace returns a replacement context that operates within the given namespace. 17 | func Namespace(c context.Context, namespace string) (context.Context, error) { 18 | if !validNamespace.MatchString(namespace) { 19 | return nil, fmt.Errorf("appengine: namespace %q does not match /%s/", namespace, validNamespace) 20 | } 21 | return internal.NamespacedContext(c, namespace), nil 22 | } 23 | 24 | // validNamespace matches valid namespace names. 25 | var validNamespace = regexp.MustCompile(`^[0-9A-Za-z._-]{0,100}$`) 26 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/buffer.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | 3 | import "unsafe" 4 | 5 | // buffer provides a mechanism for constructing a message from 6 | // multiple segments. 7 | type buffer []byte 8 | 9 | // alloc allocates size bytes and returns a pointer to the new 10 | // segment. 11 | func (w *buffer) alloc(size uintptr) unsafe.Pointer { 12 | s := int(size) 13 | if len(*w)+s > cap(*w) { 14 | old := *w 15 | *w = make([]byte, len(*w), 2*cap(*w)+s) 16 | copy(*w, old) 17 | } 18 | l := len(*w) 19 | *w = (*w)[:l+s] 20 | return unsafe.Pointer(&(*w)[l]) 21 | } 22 | 23 | // reset clears out the contents of the buffer. 24 | func (w *buffer) reset() { 25 | for i := range (*w)[:cap(*w)] { 26 | (*w)[i] = 0 27 | } 28 | *w = (*w)[:0] 29 | } 30 | 31 | func newBuffer(extra uintptr) buffer { 32 | const hdrSize = unsafe.Sizeof(outHeader{}) 33 | buf := make(buffer, hdrSize, hdrSize+extra) 34 | return buf 35 | } 36 | -------------------------------------------------------------------------------- /fs/index_type.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import ( 4 | "path/filepath" 5 | 6 | "bazil.org/fuse" 7 | "bazil.org/fuse/fs" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | type IndexType struct { 12 | Dir 13 | } 14 | 15 | func (d *IndexType) Lookup(ctx context.Context, name string) (fs.Node, error) { 16 | if p, ok := d.Views()[name]; ok { 17 | return &View{ 18 | mfs: d.mfs, 19 | Path: filepath.Join(d.Path, p), 20 | /*template*/ 21 | }, nil 22 | } 23 | 24 | return nil, fuse.ENOENT 25 | } 26 | 27 | func (it *IndexType) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { 28 | var entries = []fuse.Dirent{} 29 | for k, _ := range it.Views() { 30 | entries = append(entries, fuse.Dirent{ 31 | Inode: 0, Name: k, Type: fuse.DT_File, 32 | }) 33 | } 34 | 35 | return entries, nil 36 | } 37 | 38 | func (d *IndexType) Views() map[string]string { 39 | return map[string]string{ 40 | "_mapping": "_mapping", 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysnum_darwin.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for Darwin from sys/syscall.h 7 | 8 | use strict; 9 | 10 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 11 | print STDERR "GOARCH or GOOS not defined in environment\n"; 12 | exit 1; 13 | } 14 | 15 | my $command = "mksysnum_darwin.pl " . join(' ', @ARGV); 16 | 17 | print <){ 29 | if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ 30 | my $name = $1; 31 | my $num = $2; 32 | $name =~ y/a-z/A-Z/; 33 | print " SYS_$name = $num;" 34 | } 35 | } 36 | 37 | print < 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | struct ret 24 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 25 | { 26 | struct ret r; 27 | 28 | errno = 0; 29 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 30 | r.err = errno; 31 | return r; 32 | } 33 | 34 | // Define the use function in C so that it is not inlined. 35 | 36 | extern void use(void *) __asm__ (GOSYM_PREFIX GOPKGPATH ".use") __attribute__((noinline)); 37 | 38 | void 39 | use(void *p __attribute__ ((unused))) 40 | { 41 | } 42 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/fuse_kernel_freebsd.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | 3 | import "time" 4 | 5 | type attr struct { 6 | Ino uint64 7 | Size uint64 8 | Blocks uint64 9 | Atime uint64 10 | Mtime uint64 11 | Ctime uint64 12 | AtimeNsec uint32 13 | MtimeNsec uint32 14 | CtimeNsec uint32 15 | Mode uint32 16 | Nlink uint32 17 | Uid uint32 18 | Gid uint32 19 | Rdev uint32 20 | Blksize uint32 21 | padding uint32 22 | } 23 | 24 | func (a *attr) Crtime() time.Time { 25 | return time.Time{} 26 | } 27 | 28 | func (a *attr) SetCrtime(s uint64, ns uint32) { 29 | // ignored on freebsd 30 | } 31 | 32 | func (a *attr) SetFlags(f uint32) { 33 | // ignored on freebsd 34 | } 35 | 36 | type setattrIn struct { 37 | setattrInCommon 38 | } 39 | 40 | func (in *setattrIn) BkupTime() time.Time { 41 | return time.Time{} 42 | } 43 | 44 | func (in *setattrIn) Chgtime() time.Time { 45 | return time.Time{} 46 | } 47 | 48 | func (in *setattrIn) Flags() uint32 { 49 | return 0 50 | } 51 | 52 | func openFlags(flags uint32) OpenFlags { 53 | return OpenFlags(flags) 54 | } 55 | 56 | type getxattrIn struct { 57 | getxattrInCommon 58 | } 59 | 60 | type setxattrIn struct { 61 | setxattrInCommon 62 | } 63 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *((*Ucred)(cmsgData(h))) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | -------------------------------------------------------------------------------- /json/tags.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package json 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | // tagOptions is the string following a comma in a struct field's "json" 12 | // tag, or the empty string. It does not include the leading comma. 13 | type tagOptions string 14 | 15 | // parseTag splits a struct field's json tag into its name and 16 | // comma-separated options. 17 | func parseTag(tag string) (string, tagOptions) { 18 | if idx := strings.Index(tag, ","); idx != -1 { 19 | return tag[:idx], tagOptions(tag[idx+1:]) 20 | } 21 | return tag, tagOptions("") 22 | } 23 | 24 | // Contains reports whether a comma-separated list of options 25 | // contains a particular substr flag. substr must be surrounded by a 26 | // string boundary or commas. 27 | func (o tagOptions) Contains(optionName string) bool { 28 | if len(o) == 0 { 29 | return false 30 | } 31 | s := string(o) 32 | for s != "" { 33 | var next string 34 | i := strings.Index(s, ",") 35 | if i >= 0 { 36 | s, next = s[:i], s[i+1:] 37 | } 38 | if s == optionName { 39 | return true 40 | } 41 | s = next 42 | } 43 | return false 44 | } 45 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/identity_classic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package internal 8 | 9 | import ( 10 | "appengine" 11 | 12 | netcontext "golang.org/x/net/context" 13 | ) 14 | 15 | func DefaultVersionHostname(ctx netcontext.Context) string { 16 | return appengine.DefaultVersionHostname(fromContext(ctx)) 17 | } 18 | 19 | func RequestID(ctx netcontext.Context) string { return appengine.RequestID(fromContext(ctx)) } 20 | func Datacenter(_ netcontext.Context) string { return appengine.Datacenter() } 21 | func ServerSoftware() string { return appengine.ServerSoftware() } 22 | func ModuleName(ctx netcontext.Context) string { return appengine.ModuleName(fromContext(ctx)) } 23 | func VersionID(ctx netcontext.Context) string { return appengine.VersionID(fromContext(ctx)) } 24 | func InstanceID() string { return appengine.InstanceID() } 25 | func IsDevAppServer() bool { return appengine.IsDevAppServer() } 26 | 27 | func fullyQualifiedAppID(ctx netcontext.Context) string { return fromContext(ctx).FullyQualifiedAppID() } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for DragonFly from master list 7 | # (for example, /usr/src/sys/kern/syscalls.master). 8 | 9 | use strict; 10 | 11 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 12 | print STDERR "GOARCH or GOOS not defined in environment\n"; 13 | exit 1; 14 | } 15 | 16 | my $command = "mksysnum_dragonfly.pl " . join(' ', @ARGV); 17 | 18 | print <){ 30 | if(/^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <){ 30 | if(/^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $3; 33 | my $name = $4; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <= 0 { 36 | s, next = s[:i], s[i+1:] 37 | } 38 | if s == optionName { 39 | return true 40 | } 41 | s = next 42 | } 43 | return false 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/minio/minio-go/signature-type.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Minio Go Library for Amazon S3 Compatible Cloud Storage (C) 2015 Minio, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package minio 18 | 19 | // SignatureType is type of Authorization requested for a given HTTP request. 20 | type SignatureType int 21 | 22 | // Different types of supported signatures - default is Latest i.e SignatureV4. 23 | const ( 24 | Latest SignatureType = iota 25 | SignatureV4 26 | SignatureV2 27 | ) 28 | 29 | // isV2 - is signature SignatureV2? 30 | func (s SignatureType) isV2() bool { 31 | return s == SignatureV2 32 | } 33 | 34 | // isV4 - is signature SignatureV4? 35 | func (s SignatureType) isV4() bool { 36 | return s == SignatureV4 || s == Latest 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/op/go-logging/backend.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013, Örjan Persson. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package logging 6 | 7 | // defaultBackend is the backend used for all logging calls. 8 | var defaultBackend LeveledBackend 9 | 10 | // Backend is the interface which a log backend need to implement to be able to 11 | // be used as a logging backend. 12 | type Backend interface { 13 | Log(Level, int, *Record) error 14 | } 15 | 16 | // SetBackend replaces the backend currently set with the given new logging 17 | // backend. 18 | func SetBackend(backends ...Backend) LeveledBackend { 19 | var backend Backend 20 | if len(backends) == 1 { 21 | backend = backends[0] 22 | } else { 23 | backend = MultiLogger(backends...) 24 | } 25 | 26 | defaultBackend = AddModuleLevel(backend) 27 | return defaultBackend 28 | } 29 | 30 | // SetLevel sets the logging level for the specified module. The module 31 | // corresponds to the string specified in GetLogger. 32 | func SetLevel(level Level, module string) { 33 | defaultBackend.SetLevel(level, module) 34 | } 35 | 36 | // GetLevel returns the logging level for the specified module. 37 | func GetLevel(module string) Level { 38 | return defaultBackend.GetLevel(module) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/regen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # 3 | # This script rebuilds the generated code for the protocol buffers. 4 | # To run this you will need protoc and goprotobuf installed; 5 | # see https://github.com/golang/protobuf for instructions. 6 | 7 | PKG=google.golang.org/appengine 8 | 9 | function die() { 10 | echo 1>&2 $* 11 | exit 1 12 | } 13 | 14 | # Sanity check that the right tools are accessible. 15 | for tool in go protoc protoc-gen-go; do 16 | q=$(which $tool) || die "didn't find $tool" 17 | echo 1>&2 "$tool: $q" 18 | done 19 | 20 | echo -n 1>&2 "finding package dir... " 21 | pkgdir=$(go list -f '{{.Dir}}' $PKG) 22 | echo 1>&2 $pkgdir 23 | base=$(echo $pkgdir | sed "s,/$PKG\$,,") 24 | echo 1>&2 "base: $base" 25 | cd $base 26 | 27 | # Run protoc once per package. 28 | for dir in $(find $PKG/internal -name '*.proto' | xargs dirname | sort | uniq); do 29 | echo 1>&2 "* $dir" 30 | protoc --go_out=. $dir/*.proto 31 | done 32 | 33 | for f in $(find $PKG/internal -name '*.pb.go'); do 34 | # Remove proto.RegisterEnum calls. 35 | # These cause duplicate registration panics when these packages 36 | # are used on classic App Engine. proto.RegisterEnum only affects 37 | # parsing the text format; we don't care about that. 38 | # https://code.google.com/p/googleappengine/issues/detail?id=11670#c17 39 | sed -i '/proto.RegisterEnum/d' $f 40 | done 41 | -------------------------------------------------------------------------------- /vendor/gopkg.in/vmihailenco/msgpack.v2/time.go: -------------------------------------------------------------------------------- 1 | package msgpack 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | "time" 7 | ) 8 | 9 | var ( 10 | timeType = reflect.TypeOf((*time.Time)(nil)).Elem() 11 | ) 12 | 13 | func init() { 14 | Register(timeType, encodeTimeValue, decodeTimeValue) 15 | } 16 | 17 | func (e *Encoder) EncodeTime(tm time.Time) error { 18 | if err := e.w.WriteByte(0x92); err != nil { 19 | return err 20 | } 21 | if err := e.EncodeInt64(tm.Unix()); err != nil { 22 | return err 23 | } 24 | return e.EncodeInt(tm.Nanosecond()) 25 | } 26 | 27 | func (d *Decoder) DecodeTime() (time.Time, error) { 28 | b, err := d.r.ReadByte() 29 | if err != nil { 30 | return time.Time{}, err 31 | } 32 | if b != 0x92 { 33 | return time.Time{}, fmt.Errorf("msgpack: invalid code %x decoding time", b) 34 | } 35 | 36 | sec, err := d.DecodeInt64() 37 | if err != nil { 38 | return time.Time{}, err 39 | } 40 | nsec, err := d.DecodeInt64() 41 | if err != nil { 42 | return time.Time{}, err 43 | } 44 | return time.Unix(sec, nsec), nil 45 | } 46 | 47 | func encodeTimeValue(e *Encoder, v reflect.Value) error { 48 | tm := v.Interface().(time.Time) 49 | return e.EncodeTime(tm) 50 | } 51 | 52 | func decodeTimeValue(d *Decoder, v reflect.Value) error { 53 | tm, err := d.DecodeTime() 54 | if err != nil { 55 | return err 56 | } 57 | v.Set(reflect.ValueOf(tm)) 58 | return nil 59 | } 60 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/fs/fstestutil/testfs.go: -------------------------------------------------------------------------------- 1 | package fstestutil 2 | 3 | import ( 4 | "os" 5 | 6 | "bazil.org/fuse" 7 | "bazil.org/fuse/fs" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // SimpleFS is a trivial FS that just implements the Root method. 12 | type SimpleFS struct { 13 | Node fs.Node 14 | } 15 | 16 | var _ = fs.FS(SimpleFS{}) 17 | 18 | func (f SimpleFS) Root() (fs.Node, error) { 19 | return f.Node, nil 20 | } 21 | 22 | // File can be embedded in a struct to make it look like a file. 23 | type File struct{} 24 | 25 | func (f File) Attr(ctx context.Context, a *fuse.Attr) error { 26 | a.Mode = 0666 27 | return nil 28 | } 29 | 30 | // Dir can be embedded in a struct to make it look like a directory. 31 | type Dir struct{} 32 | 33 | func (f Dir) Attr(ctx context.Context, a *fuse.Attr) error { 34 | a.Mode = os.ModeDir | 0777 35 | return nil 36 | } 37 | 38 | // ChildMap is a directory with child nodes looked up from a map. 39 | type ChildMap map[string]fs.Node 40 | 41 | var _ = fs.Node(&ChildMap{}) 42 | var _ = fs.NodeStringLookuper(&ChildMap{}) 43 | 44 | func (f *ChildMap) Attr(ctx context.Context, a *fuse.Attr) error { 45 | a.Mode = os.ModeDir | 0777 46 | return nil 47 | } 48 | 49 | func (f *ChildMap) Lookup(ctx context.Context, name string) (fs.Node, error) { 50 | child, ok := (*f)[name] 51 | if !ok { 52 | return nil, fuse.ENOENT 53 | } 54 | return child, nil 55 | } 56 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/github.com/minio/minio-go/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | ### Developer Guidelines 3 | 4 | ``minio-go`` welcomes your contribution. To make the process as seamless as possible, we ask for the following: 5 | 6 | * Go ahead and fork the project and make your changes. We encourage pull requests to discuss code changes. 7 | - Fork it 8 | - Create your feature branch (git checkout -b my-new-feature) 9 | - Commit your changes (git commit -am 'Add some feature') 10 | - Push to the branch (git push origin my-new-feature) 11 | - Create new Pull Request 12 | 13 | * When you're ready to create a pull request, be sure to: 14 | - Have test cases for the new code. If you have questions about how to do it, please ask in your pull request. 15 | - Run `go fmt` 16 | - Squash your commits into a single commit. `git rebase -i`. It's okay to force update your pull request. 17 | - Make sure `go test -race ./...` and `go build` completes. 18 | NOTE: go test runs functional tests and requires you to have a AWS S3 account. Set them as environment variables 19 | ``ACCESS_KEY`` and ``SECRET_KEY``. To run shorter version of the tests please use ``go test -short -race ./...`` 20 | 21 | * Read [Effective Go](https://github.com/golang/go/wiki/CodeReviewComments) article from Golang project 22 | - `minio-go` project is strictly conformant with Golang style 23 | - if you happen to observe offending code, please feel free to send a pull request 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for OpenBSD from master list 7 | # (for example, /usr/src/sys/kern/syscalls.master). 8 | 9 | use strict; 10 | 11 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 12 | print STDERR "GOARCH or GOOS not defined in environment\n"; 13 | exit 1; 14 | } 15 | 16 | my $command = "mksysnum_netbsd.pl " . join(' ', @ARGV); 17 | 18 | print <){ 31 | if($line =~ /^(.*)\\$/) { 32 | # Handle continuation 33 | $line = $1; 34 | $_ =~ s/^\s+//; 35 | $line .= $_; 36 | } else { 37 | # New line 38 | $line = $_; 39 | } 40 | next if $line =~ /\\$/; 41 | if($line =~ /^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$/) { 42 | my $num = $1; 43 | my $proto = $6; 44 | my $compat = $8; 45 | my $name = "$7_$9"; 46 | 47 | $name = "$7_$11" if $11 ne ''; 48 | $name =~ y/a-z/A-Z/; 49 | 50 | if($compat eq '' || $compat eq '30' || $compat eq '50') { 51 | print " $name = $num; // $proto\n"; 52 | } 53 | } 54 | } 55 | 56 | print < 999){ 29 | # ignore deprecated syscalls that are no longer implemented 30 | # https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/unistd.h?id=refs/heads/master#n716 31 | return; 32 | } 33 | $name =~ y/a-z/A-Z/; 34 | print " SYS_$name = $num;\n"; 35 | } 36 | 37 | my $prev; 38 | open(GCC, "gcc -E -dD $ARGV[0] |") || die "can't run gcc"; 39 | while(){ 40 | if(/^#define __NR_syscalls\s+/) { 41 | # ignore redefinitions of __NR_syscalls 42 | } 43 | elsif(/^#define __NR_(\w+)\s+([0-9]+)/){ 44 | $prev = $2; 45 | fmt($1, $2); 46 | } 47 | elsif(/^#define __NR3264_(\w+)\s+([0-9]+)/){ 48 | $prev = $2; 49 | fmt($1, $2); 50 | } 51 | elsif(/^#define __NR_(\w+)\s+\(\w+\+\s*([0-9]+)\)/){ 52 | fmt($1, $prev+$2) 53 | } 54 | } 55 | 56 | print <>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 52 | 53 | written = int(writtenOut) 54 | 55 | if e1 != 0 { 56 | err = e1 57 | } 58 | return 59 | } 60 | 61 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 62 | -------------------------------------------------------------------------------- /fs/nodes.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import ( 4 | "path" 5 | "path/filepath" 6 | 7 | "github.com/dutchcoders/elasticofs/json" 8 | 9 | "bazil.org/fuse" 10 | "bazil.org/fuse/fs" 11 | "golang.org/x/net/context" 12 | ) 13 | 14 | type Nodes struct { 15 | Dir 16 | } 17 | 18 | func (d *Nodes) Views() map[string]string { 19 | return map[string]string{ 20 | "stats": "stats", 21 | } 22 | } 23 | 24 | func (d *Nodes) Lookup(ctx context.Context, name string) (fs.Node, error) { 25 | if p, ok := d.Views()[name]; ok { 26 | return &View{ 27 | mfs: d.mfs, 28 | Path: path.Join(d.Path, p), 29 | /*template*/ 30 | }, nil 31 | } 32 | 33 | return &Node{ 34 | Dir{ 35 | mfs: d.mfs, 36 | Path: path.Join(d.Path, name), 37 | /*template*/ 38 | }, 39 | }, nil 40 | 41 | return nil, fuse.ENOENT 42 | } 43 | 44 | func (dir *Nodes) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { 45 | var entries = []fuse.Dirent{} 46 | for k, _ := range dir.Views() { 47 | entries = append(entries, fuse.Dirent{ 48 | Inode: 0, Name: k, Type: fuse.DT_File, 49 | }) 50 | } 51 | 52 | // retrieve nodes 53 | path := filepath.Join(dir.Path, "stats") 54 | 55 | req, err := dir.mfs.client.NewRequest("GET", path, nil) 56 | if err != nil { 57 | return nil, err 58 | } 59 | 60 | var resp json.M 61 | if err := dir.mfs.client.Do(req, &resp); err != nil { 62 | return nil, err 63 | } 64 | 65 | if v, ok := resp["nodes"]; !ok { 66 | } else if nodes, ok := v.(json.M); !ok { 67 | } else { 68 | for k, _ := range nodes { 69 | node := &Node{ 70 | Dir{ 71 | mfs: dir.mfs, 72 | Path: k, 73 | }, 74 | } 75 | 76 | entries = append(entries, node.Dirent()) 77 | } 78 | } 79 | 80 | return entries, nil 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Go support for Protocol Buffers - Google's data interchange format 2 | 3 | Copyright 2010 The Go Authors. All rights reserved. 4 | https://github.com/golang/protobuf 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following disclaimer 14 | in the documentation and/or other materials provided with the 15 | distribution. 16 | * Neither the name of Google Inc. nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = int32(nsec / 1e9) 20 | ts.Nsec = int32(nsec % 1e9) 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = int32(nsec % 1e9 / 1e3) 27 | tv.Sec = int32(nsec / 1e9) 28 | return 29 | } 30 | 31 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 32 | k.Ident = uint32(fd) 33 | k.Filter = int16(mode) 34 | k.Flags = uint16(flags) 35 | } 36 | 37 | func (iov *Iovec) SetLen(length int) { 38 | iov.Len = uint32(length) 39 | } 40 | 41 | func (msghdr *Msghdr) SetControllen(length int) { 42 | msghdr.Controllen = uint32(length) 43 | } 44 | 45 | func (cmsg *Cmsghdr) SetLen(length int) { 46 | cmsg.Len = uint32(length) 47 | } 48 | 49 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 50 | var writtenOut uint64 = 0 51 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 52 | 53 | written = int(writtenOut) 54 | 55 | if e1 != 0 { 56 | err = e1 57 | } 58 | return 59 | } 60 | 61 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 62 | -------------------------------------------------------------------------------- /vendor/gopkg.in/vmihailenco/msgpack.v2/appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package msgpack 4 | 5 | import ( 6 | "reflect" 7 | 8 | ds "google.golang.org/appengine/datastore" 9 | ) 10 | 11 | var ( 12 | keyPtrType = reflect.TypeOf((*ds.Key)(nil)) 13 | cursorType = reflect.TypeOf((*ds.Cursor)(nil)).Elem() 14 | ) 15 | 16 | func init() { 17 | Register(keyPtrType, encodeDatastoreKeyValue, decodeDatastoreKeyValue) 18 | Register(cursorType, encodeDatastoreCursorValue, decodeDatastoreCursorValue) 19 | } 20 | 21 | func EncodeDatastoreKey(e *Encoder, key *ds.Key) error { 22 | if key == nil { 23 | return e.EncodeNil() 24 | } 25 | return e.EncodeString(key.Encode()) 26 | } 27 | 28 | func encodeDatastoreKeyValue(e *Encoder, v reflect.Value) error { 29 | key := v.Interface().(*ds.Key) 30 | return EncodeDatastoreKey(e, key) 31 | } 32 | 33 | func DecodeDatastoreKey(d *Decoder) (*ds.Key, error) { 34 | v, err := d.DecodeString() 35 | if err != nil { 36 | return nil, err 37 | } 38 | if v == "" { 39 | return nil, nil 40 | } 41 | return ds.DecodeKey(v) 42 | } 43 | 44 | func decodeDatastoreKeyValue(d *Decoder, v reflect.Value) error { 45 | key, err := DecodeDatastoreKey(d) 46 | if err != nil { 47 | return err 48 | } 49 | v.Set(reflect.ValueOf(key)) 50 | return nil 51 | } 52 | 53 | func encodeDatastoreCursorValue(e *Encoder, v reflect.Value) error { 54 | cursor := v.Interface().(ds.Cursor) 55 | return e.Encode(cursor.String()) 56 | } 57 | 58 | func decodeDatastoreCursorValue(d *Decoder, v reflect.Value) error { 59 | s, err := d.DecodeString() 60 | if err != nil { 61 | return err 62 | } 63 | cursor, err := ds.DecodeCursor(s) 64 | if err != nil { 65 | return err 66 | } 67 | v.Set(reflect.ValueOf(cursor)) 68 | return nil 69 | } 70 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // We can't use the gc-syntax .s files for gccgo. On the plus side 12 | // much of the functionality can be written directly in Go. 13 | 14 | //extern gccgoRealSyscall 15 | func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr) 16 | 17 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | syscall.Entersyscall() 19 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 20 | syscall.Exitsyscall() 21 | return r, 0, syscall.Errno(errno) 22 | } 23 | 24 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 25 | syscall.Entersyscall() 26 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) 27 | syscall.Exitsyscall() 28 | return r, 0, syscall.Errno(errno) 29 | } 30 | 31 | func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) { 32 | syscall.Entersyscall() 33 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9) 34 | syscall.Exitsyscall() 35 | return r, 0, syscall.Errno(errno) 36 | } 37 | 38 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 39 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 40 | return r, 0, syscall.Errno(errno) 41 | } 42 | 43 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 44 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) 45 | return r, 0, syscall.Errno(errno) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/minio/minio-go/tempfile.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Minio Go Library for Amazon S3 Compatible Cloud Storage (C) 2015 Minio, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package minio 18 | 19 | import ( 20 | "io/ioutil" 21 | "os" 22 | "sync" 23 | ) 24 | 25 | // tempFile - temporary file container. 26 | type tempFile struct { 27 | *os.File 28 | mutex *sync.Mutex 29 | } 30 | 31 | // newTempFile returns a new temporary file, once closed it automatically deletes itself. 32 | func newTempFile(prefix string) (*tempFile, error) { 33 | // use platform specific temp directory. 34 | file, err := ioutil.TempFile(os.TempDir(), prefix) 35 | if err != nil { 36 | return nil, err 37 | } 38 | return &tempFile{ 39 | File: file, 40 | mutex: &sync.Mutex{}, 41 | }, nil 42 | } 43 | 44 | // Close - closer wrapper to close and remove temporary file. 45 | func (t *tempFile) Close() error { 46 | t.mutex.Lock() 47 | defer t.mutex.Unlock() 48 | if t.File != nil { 49 | // Close the file. 50 | if err := t.File.Close(); err != nil { 51 | return err 52 | } 53 | // Remove file. 54 | if err := os.Remove(t.File.Name()); err != nil { 55 | return err 56 | } 57 | t.File = nil 58 | } 59 | return nil 60 | } 61 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/modules/modules_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | option go_package = "modules"; 3 | 4 | package appengine; 5 | 6 | message ModulesServiceError { 7 | enum ErrorCode { 8 | OK = 0; 9 | INVALID_MODULE = 1; 10 | INVALID_VERSION = 2; 11 | INVALID_INSTANCES = 3; 12 | TRANSIENT_ERROR = 4; 13 | UNEXPECTED_STATE = 5; 14 | } 15 | } 16 | 17 | message GetModulesRequest { 18 | } 19 | 20 | message GetModulesResponse { 21 | repeated string module = 1; 22 | } 23 | 24 | message GetVersionsRequest { 25 | optional string module = 1; 26 | } 27 | 28 | message GetVersionsResponse { 29 | repeated string version = 1; 30 | } 31 | 32 | message GetDefaultVersionRequest { 33 | optional string module = 1; 34 | } 35 | 36 | message GetDefaultVersionResponse { 37 | required string version = 1; 38 | } 39 | 40 | message GetNumInstancesRequest { 41 | optional string module = 1; 42 | optional string version = 2; 43 | } 44 | 45 | message GetNumInstancesResponse { 46 | required int64 instances = 1; 47 | } 48 | 49 | message SetNumInstancesRequest { 50 | optional string module = 1; 51 | optional string version = 2; 52 | required int64 instances = 3; 53 | } 54 | 55 | message SetNumInstancesResponse {} 56 | 57 | message StartModuleRequest { 58 | required string module = 1; 59 | required string version = 2; 60 | } 61 | 62 | message StartModuleResponse {} 63 | 64 | message StopModuleRequest { 65 | optional string module = 1; 66 | optional string version = 2; 67 | } 68 | 69 | message StopModuleResponse {} 70 | 71 | message GetHostnameRequest { 72 | optional string module = 1; 73 | optional string version = 2; 74 | optional string instance = 3; 75 | } 76 | 77 | message GetHostnameResponse { 78 | required string hostname = 1; 79 | } 80 | 81 | -------------------------------------------------------------------------------- /vendor/gopkg.in/vmihailenco/msgpack.v2/codes/codes.go: -------------------------------------------------------------------------------- 1 | package codes 2 | 3 | var ( 4 | PosFixedNumHigh byte = 0x7f 5 | NegFixedNumLow byte = 0xe0 6 | 7 | Nil byte = 0xc0 8 | 9 | False byte = 0xc2 10 | True byte = 0xc3 11 | 12 | Float byte = 0xca 13 | Double byte = 0xcb 14 | 15 | Uint8 byte = 0xcc 16 | Uint16 byte = 0xcd 17 | Uint32 byte = 0xce 18 | Uint64 byte = 0xcf 19 | 20 | Int8 byte = 0xd0 21 | Int16 byte = 0xd1 22 | Int32 byte = 0xd2 23 | Int64 byte = 0xd3 24 | 25 | FixedStrLow byte = 0xa0 26 | FixedStrHigh byte = 0xbf 27 | FixedStrMask byte = 0x1f 28 | Str8 byte = 0xd9 29 | Str16 byte = 0xda 30 | Str32 byte = 0xdb 31 | 32 | Bin8 byte = 0xc4 33 | Bin16 byte = 0xc5 34 | Bin32 byte = 0xc6 35 | 36 | FixedArrayLow byte = 0x90 37 | FixedArrayHigh byte = 0x9f 38 | FixedArrayMask byte = 0xf 39 | Array16 byte = 0xdc 40 | Array32 byte = 0xdd 41 | 42 | FixedMapLow byte = 0x80 43 | FixedMapHigh byte = 0x8f 44 | FixedMapMask byte = 0xf 45 | Map16 byte = 0xde 46 | Map32 byte = 0xdf 47 | 48 | FixExt1 byte = 0xd4 49 | FixExt2 byte = 0xd5 50 | FixExt4 byte = 0xd6 51 | FixExt8 byte = 0xd7 52 | FixExt16 byte = 0xd8 53 | Ext8 byte = 0xc7 54 | Ext16 byte = 0xc8 55 | Ext32 byte = 0xc9 56 | ) 57 | 58 | func IsFixedNum(c byte) bool { 59 | return c <= PosFixedNumHigh || c >= NegFixedNumLow 60 | } 61 | 62 | func IsFixedMap(c byte) bool { 63 | return c >= FixedMapLow && c <= FixedMapHigh 64 | } 65 | 66 | func IsFixedArray(c byte) bool { 67 | return c >= FixedArrayLow && c <= FixedArrayHigh 68 | } 69 | 70 | func IsFixedString(c byte) bool { 71 | return c >= FixedStrLow && c <= FixedStrHigh 72 | } 73 | 74 | func IsExt(c byte) bool { 75 | return (c >= FixExt1 && c <= FixExt16) || (c >= Ext8 && c <= Ext32) 76 | } 77 | -------------------------------------------------------------------------------- /vendor/github.com/op/go-logging/syslog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013, Örjan Persson. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //+build !windows,!plan9 6 | 7 | package logging 8 | 9 | import "log/syslog" 10 | 11 | // SyslogBackend is a simple logger to syslog backend. It automatically maps 12 | // the internal log levels to appropriate syslog log levels. 13 | type SyslogBackend struct { 14 | Writer *syslog.Writer 15 | } 16 | 17 | // NewSyslogBackend connects to the syslog daemon using UNIX sockets with the 18 | // given prefix. If prefix is not given, the prefix will be derived from the 19 | // launched command. 20 | func NewSyslogBackend(prefix string) (b *SyslogBackend, err error) { 21 | var w *syslog.Writer 22 | w, err = syslog.New(syslog.LOG_CRIT, prefix) 23 | return &SyslogBackend{w}, err 24 | } 25 | 26 | // NewSyslogBackendPriority is the same as NewSyslogBackend, but with custom 27 | // syslog priority, like syslog.LOG_LOCAL3|syslog.LOG_DEBUG etc. 28 | func NewSyslogBackendPriority(prefix string, priority syslog.Priority) (b *SyslogBackend, err error) { 29 | var w *syslog.Writer 30 | w, err = syslog.New(priority, prefix) 31 | return &SyslogBackend{w}, err 32 | } 33 | 34 | // Log implements the Backend interface. 35 | func (b *SyslogBackend) Log(level Level, calldepth int, rec *Record) error { 36 | line := rec.Formatted(calldepth + 1) 37 | switch level { 38 | case CRITICAL: 39 | return b.Writer.Crit(line) 40 | case ERROR: 41 | return b.Writer.Err(line) 42 | case WARNING: 43 | return b.Writer.Warning(line) 44 | case NOTICE: 45 | return b.Writer.Notice(line) 46 | case INFO: 47 | return b.Writer.Info(line) 48 | case DEBUG: 49 | return b.Writer.Debug(line) 50 | default: 51 | } 52 | panic("unhandled log level") 53 | } 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for FreeBSD from master list 7 | # (for example, /usr/src/sys/kern/syscalls.master). 8 | 9 | use strict; 10 | 11 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 12 | print STDERR "GOARCH or GOOS not defined in environment\n"; 13 | exit 1; 14 | } 15 | 16 | my $command = "mksysnum_freebsd.pl " . join(' ', @ARGV); 17 | 18 | print <){ 30 | if(/^([0-9]+)\s+\S+\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | if($name =~ /^SYS_CAP_+/ || $name =~ /^SYS___CAP_+/){ 44 | next 45 | } 46 | 47 | print " $name = $num; // $proto\n"; 48 | 49 | # We keep Capsicum syscall numbers for FreeBSD 50 | # 9-STABLE here because we are not sure whether they 51 | # are mature and stable. 52 | if($num == 513){ 53 | print " SYS_CAP_NEW = 514 // { int cap_new(int fd, uint64_t rights); }\n"; 54 | print " SYS_CAP_GETRIGHTS = 515 // { int cap_getrights(int fd, \\\n"; 55 | print " SYS_CAP_ENTER = 516 // { int cap_enter(void); }\n"; 56 | print " SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); }\n"; 57 | } 58 | } 59 | } 60 | 61 | print < 0 || len(problems.extra) > 0 { 67 | return problems 68 | } 69 | return nil 70 | } 71 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/protocol.go: -------------------------------------------------------------------------------- 1 | package fuse 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // Protocol is a FUSE protocol version number. 8 | type Protocol struct { 9 | Major uint32 10 | Minor uint32 11 | } 12 | 13 | func (p Protocol) String() string { 14 | return fmt.Sprintf("%d.%d", p.Major, p.Minor) 15 | } 16 | 17 | // LT returns whether a is less than b. 18 | func (a Protocol) LT(b Protocol) bool { 19 | return a.Major < b.Major || 20 | (a.Major == b.Major && a.Minor < b.Minor) 21 | } 22 | 23 | // GE returns whether a is greater than or equal to b. 24 | func (a Protocol) GE(b Protocol) bool { 25 | return a.Major > b.Major || 26 | (a.Major == b.Major && a.Minor >= b.Minor) 27 | } 28 | 29 | func (a Protocol) is79() bool { 30 | return a.GE(Protocol{7, 9}) 31 | } 32 | 33 | // HasAttrBlockSize returns whether Attr.BlockSize is respected by the 34 | // kernel. 35 | func (a Protocol) HasAttrBlockSize() bool { 36 | return a.is79() 37 | } 38 | 39 | // HasReadWriteFlags returns whether ReadRequest/WriteRequest 40 | // fields Flags and FileFlags are valid. 41 | func (a Protocol) HasReadWriteFlags() bool { 42 | return a.is79() 43 | } 44 | 45 | // HasGetattrFlags returns whether GetattrRequest field Flags is 46 | // valid. 47 | func (a Protocol) HasGetattrFlags() bool { 48 | return a.is79() 49 | } 50 | 51 | func (a Protocol) is710() bool { 52 | return a.GE(Protocol{7, 10}) 53 | } 54 | 55 | // HasOpenNonSeekable returns whether OpenResponse field Flags flag 56 | // OpenNonSeekable is supported. 57 | func (a Protocol) HasOpenNonSeekable() bool { 58 | return a.is710() 59 | } 60 | 61 | func (a Protocol) is712() bool { 62 | return a.GE(Protocol{7, 12}) 63 | } 64 | 65 | // HasUmask returns whether CreateRequest/MkdirRequest/MknodRequest 66 | // field Umask is valid. 67 | func (a Protocol) HasUmask() bool { 68 | return a.is712() 69 | } 70 | 71 | // HasInvalidate returns whether InvalidateNode/InvalidateEntry are 72 | // supported. 73 | func (a Protocol) HasInvalidate() bool { 74 | return a.is712() 75 | } 76 | -------------------------------------------------------------------------------- /fs/index.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import ( 4 | "path/filepath" 5 | 6 | "github.com/dutchcoders/elasticofs/json" 7 | 8 | "bazil.org/fuse" 9 | "bazil.org/fuse/fs" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | type Index struct { 14 | Dir 15 | } 16 | 17 | func (d *Index) Lookup(ctx context.Context, name string) (fs.Node, error) { 18 | if p, ok := d.Views()[name]; ok { 19 | return &View{ 20 | mfs: d.mfs, 21 | Path: filepath.Join(d.Path, p), 22 | /*template*/ 23 | }, nil 24 | } else { 25 | return &IndexType{ 26 | Dir{ 27 | mfs: d.mfs, 28 | Path: filepath.Join(d.Path, name), 29 | }, 30 | /*template*/ 31 | }, nil 32 | } 33 | 34 | return nil, fuse.ENOENT 35 | } 36 | 37 | func (d *Index) Views() map[string]string { 38 | return map[string]string{ 39 | "_mapping": "_mapping", 40 | "_stats": "_stats", 41 | "_field_stats": "_field_stats", 42 | } 43 | } 44 | 45 | func (index *Index) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { 46 | var entries = []fuse.Dirent{} 47 | for k, _ := range index.Views() { 48 | entries = append(entries, fuse.Dirent{ 49 | Inode: 0, Name: k, Type: fuse.DT_File, 50 | }) 51 | } 52 | 53 | path := "/" 54 | path = filepath.Join(path, index.Path) 55 | path = filepath.Join(path, "_mapping") 56 | 57 | req, err := index.mfs.client.NewRequest("GET", path, nil) 58 | if err != nil { 59 | return nil, err 60 | } 61 | 62 | var resp json.M 63 | if err := index.mfs.client.Do(req, &resp); err != nil { 64 | return nil, err 65 | } 66 | 67 | if v, ok := resp[index.Path]; !ok { 68 | } else if indices, ok := v.(json.M); !ok { 69 | } else if m, ok := indices["mappings"]; !ok { 70 | } else if mappings, ok := m.(json.M); !ok { 71 | } else { 72 | for k, _ := range mappings { 73 | index := &IndexType{ 74 | Dir{ 75 | mfs: index.mfs, 76 | Path: filepath.Join(index.Path, k), 77 | }, 78 | } 79 | 80 | entries = append(entries, index.Dirent()) 81 | } 82 | } 83 | 84 | return entries, nil 85 | } 86 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | func Getpagesize() int { return 4096 } 13 | 14 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 15 | 16 | func NsecToTimespec(nsec int64) (ts Timespec) { 17 | ts.Sec = int32(nsec / 1e9) 18 | ts.Nsec = int32(nsec % 1e9) 19 | return 20 | } 21 | 22 | func NsecToTimeval(nsec int64) (tv Timeval) { 23 | nsec += 999 // round up to microsecond 24 | tv.Usec = int32(nsec % 1e9 / 1e3) 25 | tv.Sec = int32(nsec / 1e9) 26 | return 27 | } 28 | 29 | //sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error) 30 | func Gettimeofday(tv *Timeval) (err error) { 31 | // The tv passed to gettimeofday must be non-nil 32 | // but is otherwise unused. The answers come back 33 | // in the two registers. 34 | sec, usec, err := gettimeofday(tv) 35 | tv.Sec = int32(sec) 36 | tv.Usec = int32(usec) 37 | return err 38 | } 39 | 40 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 41 | k.Ident = uint32(fd) 42 | k.Filter = int16(mode) 43 | k.Flags = uint16(flags) 44 | } 45 | 46 | func (iov *Iovec) SetLen(length int) { 47 | iov.Len = uint32(length) 48 | } 49 | 50 | func (msghdr *Msghdr) SetControllen(length int) { 51 | msghdr.Controllen = uint32(length) 52 | } 53 | 54 | func (cmsg *Cmsghdr) SetLen(length int) { 55 | cmsg.Len = uint32(length) 56 | } 57 | 58 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 59 | var length = uint64(count) 60 | 61 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0) 62 | 63 | written = int(length) 64 | 65 | if e1 != 0 { 66 | err = e1 67 | } 68 | return 69 | } 70 | 71 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 72 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/proto/Makefile: -------------------------------------------------------------------------------- 1 | # Go support for Protocol Buffers - Google's data interchange format 2 | # 3 | # Copyright 2010 The Go Authors. All rights reserved. 4 | # https://github.com/golang/protobuf 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above 13 | # copyright notice, this list of conditions and the following disclaimer 14 | # in the documentation and/or other materials provided with the 15 | # distribution. 16 | # * Neither the name of Google Inc. nor the names of its 17 | # contributors may be used to endorse or promote products derived from 18 | # this software without specific prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | install: 33 | go install 34 | 35 | test: install generate-test-pbs 36 | go test 37 | 38 | 39 | generate-test-pbs: 40 | make install 41 | make -C testdata 42 | protoc --go_out=Mtestdata/test.proto=github.com/golang/protobuf/proto/testdata,Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any:. proto3_proto/proto3.proto 43 | make 44 | -------------------------------------------------------------------------------- /vendor/github.com/op/go-logging/multi.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013, Örjan Persson. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package logging 6 | 7 | // TODO remove Level stuff from the multi logger. Do one thing. 8 | 9 | // multiLogger is a log multiplexer which can be used to utilize multiple log 10 | // backends at once. 11 | type multiLogger struct { 12 | backends []LeveledBackend 13 | } 14 | 15 | // MultiLogger creates a logger which contain multiple loggers. 16 | func MultiLogger(backends ...Backend) LeveledBackend { 17 | var leveledBackends []LeveledBackend 18 | for _, backend := range backends { 19 | leveledBackends = append(leveledBackends, AddModuleLevel(backend)) 20 | } 21 | return &multiLogger{leveledBackends} 22 | } 23 | 24 | // Log passes the log record to all backends. 25 | func (b *multiLogger) Log(level Level, calldepth int, rec *Record) (err error) { 26 | for _, backend := range b.backends { 27 | if backend.IsEnabledFor(level, rec.Module) { 28 | // Shallow copy of the record for the formatted cache on Record and get the 29 | // record formatter from the backend. 30 | r2 := *rec 31 | if e := backend.Log(level, calldepth+1, &r2); e != nil { 32 | err = e 33 | } 34 | } 35 | } 36 | return 37 | } 38 | 39 | // GetLevel returns the highest level enabled by all backends. 40 | func (b *multiLogger) GetLevel(module string) Level { 41 | var level Level 42 | for _, backend := range b.backends { 43 | if backendLevel := backend.GetLevel(module); backendLevel > level { 44 | level = backendLevel 45 | } 46 | } 47 | return level 48 | } 49 | 50 | // SetLevel propagates the same level to all backends. 51 | func (b *multiLogger) SetLevel(level Level, module string) { 52 | for _, backend := range b.backends { 53 | backend.SetLevel(level, module) 54 | } 55 | } 56 | 57 | // IsEnabledFor returns true if any of the backends are enabled for it. 58 | func (b *multiLogger) IsEnabledFor(level Level, module string) bool { 59 | for _, backend := range b.backends { 60 | if backend.IsEnabledFor(level, module) { 61 | return true 62 | } 63 | } 64 | return false 65 | } 66 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64,darwin 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 16384 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = nsec % 1e9 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = int32(nsec % 1e9 / 1e3) 27 | tv.Sec = int64(nsec / 1e9) 28 | return 29 | } 30 | 31 | //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) 32 | func Gettimeofday(tv *Timeval) (err error) { 33 | // The tv passed to gettimeofday must be non-nil 34 | // but is otherwise unused. The answers come back 35 | // in the two registers. 36 | sec, usec, err := gettimeofday(tv) 37 | tv.Sec = sec 38 | tv.Usec = usec 39 | return err 40 | } 41 | 42 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 43 | k.Ident = uint64(fd) 44 | k.Filter = int16(mode) 45 | k.Flags = uint16(flags) 46 | } 47 | 48 | func (iov *Iovec) SetLen(length int) { 49 | iov.Len = uint64(length) 50 | } 51 | 52 | func (msghdr *Msghdr) SetControllen(length int) { 53 | msghdr.Controllen = uint32(length) 54 | } 55 | 56 | func (cmsg *Cmsghdr) SetLen(length int) { 57 | cmsg.Len = uint32(length) 58 | } 59 | 60 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 61 | var length = uint64(count) 62 | 63 | _, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0) 64 | 65 | written = int(length) 66 | 67 | if e1 != 0 { 68 | err = e1 69 | } 70 | return 71 | } 72 | 73 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 74 | 75 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 76 | // of darwin/arm64 the syscall is called sysctl instead of __sysctl. 77 | const SYS___SYSCTL = SYS_SYSCTL 78 | -------------------------------------------------------------------------------- /vendor/github.com/minio/minio-go/api-put-object-copy.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Minio Go Library for Amazon S3 Compatible Cloud Storage (C) 2016 Minio, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package minio 18 | 19 | import "net/http" 20 | 21 | // CopyObject - copy a source object into a new object with the provided name in the provided bucket 22 | func (c Client) CopyObject(bucketName string, objectName string, objectSource string, cpCond CopyConditions) error { 23 | // Input validation. 24 | if err := isValidBucketName(bucketName); err != nil { 25 | return err 26 | } 27 | if err := isValidObjectName(objectName); err != nil { 28 | return err 29 | } 30 | if objectSource == "" { 31 | return ErrInvalidArgument("Object source cannot be empty.") 32 | } 33 | 34 | // customHeaders apply headers. 35 | customHeaders := make(http.Header) 36 | for _, cond := range cpCond.conditions { 37 | customHeaders.Set(cond.key, cond.value) 38 | } 39 | 40 | // Set copy source. 41 | customHeaders.Set("x-amz-copy-source", urlEncodePath(objectSource)) 42 | 43 | // Execute PUT on objectName. 44 | resp, err := c.executeMethod("PUT", requestMetadata{ 45 | bucketName: bucketName, 46 | objectName: objectName, 47 | customHeader: customHeaders, 48 | }) 49 | defer closeResponse(resp) 50 | if err != nil { 51 | return err 52 | } 53 | if resp != nil { 54 | if resp.StatusCode != http.StatusOK { 55 | return httpRespToErrorResponse(resp, bucketName, objectName) 56 | } 57 | } 58 | 59 | // Decode copy response on success. 60 | cpObjRes := copyObjectResult{} 61 | err = xmlDecoder(resp.Body, &cpObjRes) 62 | if err != nil { 63 | return err 64 | } 65 | 66 | // Return nil on success. 67 | return nil 68 | } 69 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,darwin 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = int32(nsec / 1e9) 20 | ts.Nsec = int32(nsec % 1e9) 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = int32(nsec % 1e9 / 1e3) 27 | tv.Sec = int32(nsec / 1e9) 28 | return 29 | } 30 | 31 | //sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error) 32 | func Gettimeofday(tv *Timeval) (err error) { 33 | // The tv passed to gettimeofday must be non-nil 34 | // but is otherwise unused. The answers come back 35 | // in the two registers. 36 | sec, usec, err := gettimeofday(tv) 37 | tv.Sec = int32(sec) 38 | tv.Usec = int32(usec) 39 | return err 40 | } 41 | 42 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 43 | k.Ident = uint32(fd) 44 | k.Filter = int16(mode) 45 | k.Flags = uint16(flags) 46 | } 47 | 48 | func (iov *Iovec) SetLen(length int) { 49 | iov.Len = uint32(length) 50 | } 51 | 52 | func (msghdr *Msghdr) SetControllen(length int) { 53 | msghdr.Controllen = uint32(length) 54 | } 55 | 56 | func (cmsg *Cmsghdr) SetLen(length int) { 57 | cmsg.Len = uint32(length) 58 | } 59 | 60 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 61 | var length = uint64(count) 62 | 63 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0) 64 | 65 | written = int(length) 66 | 67 | if e1 != 0 { 68 | err = e1 69 | } 70 | return 71 | } 72 | 73 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 74 | 75 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 76 | // of darwin/386 the syscall is called sysctl instead of __sysctl. 77 | const SYS___SYSCTL = SYS_SYSCTL 78 | -------------------------------------------------------------------------------- /vendor/gopkg.in/vmihailenco/msgpack.v2/README.md: -------------------------------------------------------------------------------- 1 | # MessagePack encoding for Golang [![Build Status](https://travis-ci.org/vmihailenco/msgpack.svg?branch=v2)](https://travis-ci.org/vmihailenco/msgpack) 2 | 3 | Supports: 4 | - Primitives, arrays, maps, structs, time.Time and interface{}. 5 | - Appengine *datastore.Key and datastore.Cursor. 6 | - [CustomEncoder](http://godoc.org/gopkg.in/vmihailenco/msgpack.v2#example-CustomEncoder)/CustomDecoder interfaces for custom encoding. 7 | - [Extensions](http://godoc.org/gopkg.in/vmihailenco/msgpack.v2#example-RegisterExt) to encode type information. 8 | - Fields renaming using `msgpack:"my_field_name"`. 9 | - Structs inlining using `msgpack:",inline"`. 10 | - Omitempty flag using `msgpack:",omitempty"`. 11 | - [Map keys sorting](https://godoc.org/gopkg.in/vmihailenco/msgpack.v2#Encoder.SortMapKeys). 12 | - [Msgpack query](https://godoc.org/gopkg.in/vmihailenco/msgpack.v2#example-Decoder-Query) - simple but very efficient. 13 | 14 | API docs: http://godoc.org/gopkg.in/vmihailenco/msgpack.v2. 15 | Examples: http://godoc.org/gopkg.in/vmihailenco/msgpack.v2#pkg-examples. 16 | 17 | ## Installation 18 | 19 | Install: 20 | 21 | go get gopkg.in/vmihailenco/msgpack.v2 22 | 23 | ## Quickstart 24 | 25 | ```go 26 | func ExampleMarshal() { 27 | b, err := msgpack.Marshal(true) 28 | if err != nil { 29 | panic(err) 30 | } 31 | fmt.Printf("%#v\n", b) 32 | // Output: 33 | 34 | var out bool 35 | err = msgpack.Unmarshal([]byte{0xc3}, &out) 36 | if err != nil { 37 | panic(err) 38 | } 39 | fmt.Println(out) 40 | // Output: []byte{0xc3} 41 | // true 42 | } 43 | ``` 44 | 45 | ## Benchmark 46 | 47 | ``` 48 | BenchmarkStructVmihailencoMsgpack-4 200000 12814 ns/op 2128 B/op 26 allocs/op 49 | BenchmarkStructUgorjiGoMsgpack-4 100000 17678 ns/op 3616 B/op 70 allocs/op 50 | BenchmarkStructUgorjiGoCodec-4 100000 19053 ns/op 7346 B/op 23 allocs/op 51 | BenchmarkStructJSON-4 20000 69438 ns/op 7864 B/op 26 allocs/op 52 | BenchmarkStructGOB-4 10000 104331 ns/op 14664 B/op 278 allocs/op 53 | ``` 54 | 55 | ## Howto 56 | 57 | Please go through [examples](http://godoc.org/gopkg.in/vmihailenco/msgpack.v2#pkg-examples) to get an idea how to use this package. 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,darwin 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) 15 | 16 | func Getpagesize() int { return 4096 } 17 | 18 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 19 | 20 | func NsecToTimespec(nsec int64) (ts Timespec) { 21 | ts.Sec = nsec / 1e9 22 | ts.Nsec = nsec % 1e9 23 | return 24 | } 25 | 26 | func NsecToTimeval(nsec int64) (tv Timeval) { 27 | nsec += 999 // round up to microsecond 28 | tv.Usec = int32(nsec % 1e9 / 1e3) 29 | tv.Sec = int64(nsec / 1e9) 30 | return 31 | } 32 | 33 | //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) 34 | func Gettimeofday(tv *Timeval) (err error) { 35 | // The tv passed to gettimeofday must be non-nil 36 | // but is otherwise unused. The answers come back 37 | // in the two registers. 38 | sec, usec, err := gettimeofday(tv) 39 | tv.Sec = sec 40 | tv.Usec = usec 41 | return err 42 | } 43 | 44 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 45 | k.Ident = uint64(fd) 46 | k.Filter = int16(mode) 47 | k.Flags = uint16(flags) 48 | } 49 | 50 | func (iov *Iovec) SetLen(length int) { 51 | iov.Len = uint64(length) 52 | } 53 | 54 | func (msghdr *Msghdr) SetControllen(length int) { 55 | msghdr.Controllen = uint32(length) 56 | } 57 | 58 | func (cmsg *Cmsghdr) SetLen(length int) { 59 | cmsg.Len = uint32(length) 60 | } 61 | 62 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 63 | var length = uint64(count) 64 | 65 | _, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0) 66 | 67 | written = int(length) 68 | 69 | if e1 != 0 { 70 | err = e1 71 | } 72 | return 73 | } 74 | 75 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 76 | 77 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 78 | // of darwin/amd64 the syscall is called sysctl instead of __sysctl. 79 | const SYS___SYSCTL = SYS_SYSCTL 80 | -------------------------------------------------------------------------------- /vendor/bazil.org/fuse/fs/tree.go: -------------------------------------------------------------------------------- 1 | // FUSE directory tree, for servers that wish to use it with the service loop. 2 | 3 | package fs 4 | 5 | import ( 6 | "os" 7 | pathpkg "path" 8 | "strings" 9 | 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | import ( 14 | "bazil.org/fuse" 15 | ) 16 | 17 | // A Tree implements a basic read-only directory tree for FUSE. 18 | // The Nodes contained in it may still be writable. 19 | type Tree struct { 20 | tree 21 | } 22 | 23 | func (t *Tree) Root() (Node, error) { 24 | return &t.tree, nil 25 | } 26 | 27 | // Add adds the path to the tree, resolving to the given node. 28 | // If path or a prefix of path has already been added to the tree, 29 | // Add panics. 30 | // 31 | // Add is only safe to call before starting to serve requests. 32 | func (t *Tree) Add(path string, node Node) { 33 | path = pathpkg.Clean("/" + path)[1:] 34 | elems := strings.Split(path, "/") 35 | dir := Node(&t.tree) 36 | for i, elem := range elems { 37 | dt, ok := dir.(*tree) 38 | if !ok { 39 | panic("fuse: Tree.Add for " + strings.Join(elems[:i], "/") + " and " + path) 40 | } 41 | n := dt.lookup(elem) 42 | if n != nil { 43 | if i+1 == len(elems) { 44 | panic("fuse: Tree.Add for " + path + " conflicts with " + elem) 45 | } 46 | dir = n 47 | } else { 48 | if i+1 == len(elems) { 49 | dt.add(elem, node) 50 | } else { 51 | dir = &tree{} 52 | dt.add(elem, dir) 53 | } 54 | } 55 | } 56 | } 57 | 58 | type treeDir struct { 59 | name string 60 | node Node 61 | } 62 | 63 | type tree struct { 64 | dir []treeDir 65 | } 66 | 67 | func (t *tree) lookup(name string) Node { 68 | for _, d := range t.dir { 69 | if d.name == name { 70 | return d.node 71 | } 72 | } 73 | return nil 74 | } 75 | 76 | func (t *tree) add(name string, n Node) { 77 | t.dir = append(t.dir, treeDir{name, n}) 78 | } 79 | 80 | func (t *tree) Attr(ctx context.Context, a *fuse.Attr) error { 81 | a.Mode = os.ModeDir | 0555 82 | return nil 83 | } 84 | 85 | func (t *tree) Lookup(ctx context.Context, name string) (Node, error) { 86 | n := t.lookup(name) 87 | if n != nil { 88 | return n, nil 89 | } 90 | return nil, fuse.ENOENT 91 | } 92 | 93 | func (t *tree) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { 94 | var out []fuse.Dirent 95 | for _, d := range t.dir { 96 | out = append(out, fuse.Dirent{Name: d.name}) 97 | } 98 | return out, nil 99 | } 100 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_unix_solaris.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "syscall" 7 | "time" 8 | "unsafe" 9 | 10 | "golang.org/x/sys/unix" 11 | ) 12 | 13 | // flock acquires an advisory lock on a file descriptor. 14 | func flock(db *DB, mode os.FileMode, exclusive bool, timeout time.Duration) error { 15 | var t time.Time 16 | for { 17 | // If we're beyond our timeout then return an error. 18 | // This can only occur after we've attempted a flock once. 19 | if t.IsZero() { 20 | t = time.Now() 21 | } else if timeout > 0 && time.Since(t) > timeout { 22 | return ErrTimeout 23 | } 24 | var lock syscall.Flock_t 25 | lock.Start = 0 26 | lock.Len = 0 27 | lock.Pid = 0 28 | lock.Whence = 0 29 | lock.Pid = 0 30 | if exclusive { 31 | lock.Type = syscall.F_WRLCK 32 | } else { 33 | lock.Type = syscall.F_RDLCK 34 | } 35 | err := syscall.FcntlFlock(db.file.Fd(), syscall.F_SETLK, &lock) 36 | if err == nil { 37 | return nil 38 | } else if err != syscall.EAGAIN { 39 | return err 40 | } 41 | 42 | // Wait for a bit and try again. 43 | time.Sleep(50 * time.Millisecond) 44 | } 45 | } 46 | 47 | // funlock releases an advisory lock on a file descriptor. 48 | func funlock(db *DB) error { 49 | var lock syscall.Flock_t 50 | lock.Start = 0 51 | lock.Len = 0 52 | lock.Type = syscall.F_UNLCK 53 | lock.Whence = 0 54 | return syscall.FcntlFlock(uintptr(db.file.Fd()), syscall.F_SETLK, &lock) 55 | } 56 | 57 | // mmap memory maps a DB's data file. 58 | func mmap(db *DB, sz int) error { 59 | // Map the data file to memory. 60 | b, err := unix.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED|db.MmapFlags) 61 | if err != nil { 62 | return err 63 | } 64 | 65 | // Advise the kernel that the mmap is accessed randomly. 66 | if err := unix.Madvise(b, syscall.MADV_RANDOM); err != nil { 67 | return fmt.Errorf("madvise: %s", err) 68 | } 69 | 70 | // Save the original byte slice and convert to a byte array pointer. 71 | db.dataref = b 72 | db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0])) 73 | db.datasz = sz 74 | return nil 75 | } 76 | 77 | // munmap unmaps a DB's data file from memory. 78 | func munmap(db *DB) error { 79 | // Ignore the unmap if we have no mapped data. 80 | if db.dataref == nil { 81 | return nil 82 | } 83 | 84 | // Unmap using the original byte slice. 85 | err := unix.Munmap(db.dataref) 86 | db.dataref = nil 87 | db.data = nil 88 | db.datasz = 0 89 | return err 90 | } 91 | -------------------------------------------------------------------------------- /vendor/github.com/minio/minio-go/hook-reader.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Minio Go Library for Amazon S3 Compatible Cloud Storage (C) 2015, 2016 Minio, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package minio 18 | 19 | import "io" 20 | 21 | // hookReader hooks additional reader in the source stream. It is 22 | // useful for making progress bars. Second reader is appropriately 23 | // notified about the exact number of bytes read from the primary 24 | // source on each Read operation. 25 | type hookReader struct { 26 | source io.Reader 27 | hook io.Reader 28 | } 29 | 30 | // Seek implements io.Seeker. Seeks source first, and if necessary 31 | // seeks hook if Seek method is appropriately found. 32 | func (hr *hookReader) Seek(offset int64, whence int) (n int64, err error) { 33 | // Verify for source has embedded Seeker, use it. 34 | sourceSeeker, ok := hr.source.(io.Seeker) 35 | if ok { 36 | return sourceSeeker.Seek(offset, whence) 37 | } 38 | // Verify if hook has embedded Seeker, use it. 39 | hookSeeker, ok := hr.hook.(io.Seeker) 40 | if ok { 41 | return hookSeeker.Seek(offset, whence) 42 | } 43 | return n, nil 44 | } 45 | 46 | // Read implements io.Reader. Always reads from the source, the return 47 | // value 'n' number of bytes are reported through the hook. Returns 48 | // error for all non io.EOF conditions. 49 | func (hr *hookReader) Read(b []byte) (n int, err error) { 50 | n, err = hr.source.Read(b) 51 | if err != nil && err != io.EOF { 52 | return n, err 53 | } 54 | // Progress the hook with the total read bytes from the source. 55 | if _, herr := hr.hook.Read(b[:n]); herr != nil { 56 | if herr != io.EOF { 57 | return n, herr 58 | } 59 | } 60 | return n, err 61 | } 62 | 63 | // newHook returns a io.ReadSeeker which implements hookReader that 64 | // reports the data read from the source to the hook. 65 | func newHook(source, hook io.Reader) io.Reader { 66 | if hook == nil { 67 | return source 68 | } 69 | return &hookReader{source, hook} 70 | } 71 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!plan9,!solaris 2 | 3 | package bolt 4 | 5 | import ( 6 | "fmt" 7 | "os" 8 | "syscall" 9 | "time" 10 | "unsafe" 11 | ) 12 | 13 | // flock acquires an advisory lock on a file descriptor. 14 | func flock(db *DB, mode os.FileMode, exclusive bool, timeout time.Duration) error { 15 | var t time.Time 16 | for { 17 | // If we're beyond our timeout then return an error. 18 | // This can only occur after we've attempted a flock once. 19 | if t.IsZero() { 20 | t = time.Now() 21 | } else if timeout > 0 && time.Since(t) > timeout { 22 | return ErrTimeout 23 | } 24 | flag := syscall.LOCK_SH 25 | if exclusive { 26 | flag = syscall.LOCK_EX 27 | } 28 | 29 | // Otherwise attempt to obtain an exclusive lock. 30 | err := syscall.Flock(int(db.file.Fd()), flag|syscall.LOCK_NB) 31 | if err == nil { 32 | return nil 33 | } else if err != syscall.EWOULDBLOCK { 34 | return err 35 | } 36 | 37 | // Wait for a bit and try again. 38 | time.Sleep(50 * time.Millisecond) 39 | } 40 | } 41 | 42 | // funlock releases an advisory lock on a file descriptor. 43 | func funlock(db *DB) error { 44 | return syscall.Flock(int(db.file.Fd()), syscall.LOCK_UN) 45 | } 46 | 47 | // mmap memory maps a DB's data file. 48 | func mmap(db *DB, sz int) error { 49 | // Map the data file to memory. 50 | b, err := syscall.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED|db.MmapFlags) 51 | if err != nil { 52 | return err 53 | } 54 | 55 | // Advise the kernel that the mmap is accessed randomly. 56 | if err := madvise(b, syscall.MADV_RANDOM); err != nil { 57 | return fmt.Errorf("madvise: %s", err) 58 | } 59 | 60 | // Save the original byte slice and convert to a byte array pointer. 61 | db.dataref = b 62 | db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0])) 63 | db.datasz = sz 64 | return nil 65 | } 66 | 67 | // munmap unmaps a DB's data file from memory. 68 | func munmap(db *DB) error { 69 | // Ignore the unmap if we have no mapped data. 70 | if db.dataref == nil { 71 | return nil 72 | } 73 | 74 | // Unmap using the original byte slice. 75 | err := syscall.Munmap(db.dataref) 76 | db.dataref = nil 77 | db.data = nil 78 | db.datasz = 0 79 | return err 80 | } 81 | 82 | // NOTE: This function is copied from stdlib because it is not available on darwin. 83 | func madvise(b []byte, advice int) (err error) { 84 | _, _, e1 := syscall.Syscall(syscall.SYS_MADVISE, uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), uintptr(advice)) 85 | if e1 != 0 { 86 | err = e1 87 | } 88 | return 89 | } 90 | -------------------------------------------------------------------------------- /fs/root.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import ( 4 | "path/filepath" 5 | 6 | "github.com/dutchcoders/elasticofs/json" 7 | 8 | "bazil.org/fuse" 9 | "bazil.org/fuse/fs" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | type Root struct { 14 | Dir 15 | } 16 | 17 | func (d *Root) Views() map[string]string { 18 | return map[string]string{ 19 | "_stats": "_stats", 20 | "_field_stats": "_field_stats", 21 | } 22 | } 23 | 24 | func (d *Root) Lookup(ctx context.Context, name string) (fs.Node, error) { 25 | if p, ok := d.Views()[name]; ok { 26 | return &View{ 27 | mfs: d.mfs, 28 | Path: filepath.Join(d.Path, p), 29 | /*template*/ 30 | }, nil 31 | } 32 | 33 | switch { 34 | case name == "_nodes": 35 | return &Nodes{ 36 | Dir: Dir{ 37 | mfs: d.mfs, 38 | Path: "_nodes", 39 | }, 40 | }, nil 41 | case name == "_cat": 42 | return &Cat{ 43 | Dir: Dir{ 44 | mfs: d.mfs, 45 | Path: "_cat", 46 | }, 47 | }, nil 48 | case name == "_cluster": 49 | return &Cluster{ 50 | Dir: Dir{ 51 | mfs: d.mfs, 52 | Path: "_cluster", 53 | }, 54 | }, nil 55 | default: 56 | return &Index{ 57 | Dir: Dir{ 58 | mfs: d.mfs, 59 | Path: name, 60 | }, 61 | }, nil 62 | } 63 | return nil, fuse.ENOENT 64 | } 65 | 66 | func (dir *Root) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) { 67 | var entries = []fuse.Dirent{} 68 | for k, _ := range dir.Views() { 69 | entries = append(entries, fuse.Dirent{ 70 | Inode: 0, Name: k, Type: fuse.DT_File, 71 | }) 72 | } 73 | 74 | entries = append(entries, fuse.Dirent{ 75 | Inode: 0, Name: "_cluster", Type: fuse.DT_Dir, 76 | }) 77 | 78 | entries = append(entries, fuse.Dirent{ 79 | Inode: 0, Name: "_cat", Type: fuse.DT_Dir, 80 | }) 81 | 82 | entries = append(entries, fuse.Dirent{ 83 | Inode: 0, Name: "_nodes", Type: fuse.DT_Dir, 84 | }) 85 | 86 | // retrieve indexes 87 | path := filepath.Join(dir.Path, "_stats") 88 | 89 | req, err := dir.mfs.client.NewRequest("GET", path, nil) 90 | if err != nil { 91 | return nil, err 92 | } 93 | 94 | var resp json.M 95 | if err := dir.mfs.client.Do(req, &resp); err != nil { 96 | return nil, err 97 | } 98 | 99 | if v, ok := resp["indices"]; !ok { 100 | } else if indices, ok := v.(json.M); !ok { 101 | } else { 102 | for k, _ := range indices { 103 | index := &Index{ 104 | Dir{ 105 | mfs: dir.mfs, 106 | Path: k, 107 | }, 108 | } 109 | 110 | entries = append(entries, index.Dirent()) 111 | } 112 | } 113 | 114 | return entries, nil 115 | } 116 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ElasticoFS 2 | ElasticoFS is a fuse driver for Elasticsearch clusters. Currently the most basic options are working, retrieving cluster and node status. 3 | 4 | Navigating through Elasticsearch is now as easy as through your /proc file system. Tab completion, grepping and lessing are all completely working. 5 | 6 | ## Samples 7 | 8 | ``` 9 | $ cat /elasticsearch/_cluster/health 10 | {"cluster_name":"elasticsearch_remco","status":"yellow","timed_out":false,"number_of_nodes":1,"number_of_data_nodes":1,"active_primary_shards":41,"active_shards":41,"relocating_shards":0,"initializing_shards":0,"unassigned_shards":41,"delayed_unassigned_shards":0,"number_of_pending_tasks":0,"number_of_in_flight_fetch":0,"task_max_waiting_in_queue_millis":0,"active_shards_percent_as_number":50.0}cat: e: No such file or directory 11 | ``` 12 | 13 | ``` 14 | $ cat /elasticsearch/_cat/nodes 15 | 172.16.84.1 172.16.84.1 10 99 2.41 d * Dead Girl 16 | ``` 17 | 18 | ``` 19 | $ cat /elasticsearch/darksearch/_mapping |json_pp |less 20 | ``` 21 | 22 | ``` 23 | $ cat /elasticsearch/_stats |grep -o -E \"total\":[0-9]+ 24 | ``` 25 | 26 | ``` 27 | $ find /elasticsearch/ 28 | /elasticsearch/ 29 | /elasticsearch/_stats 30 | /elasticsearch/_field_stats 31 | /elasticsearch/_cluster 32 | /elasticsearch/_cluster/health 33 | /elasticsearch/_cluster/stats 34 | /elasticsearch/_cluster/settings 35 | /elasticsearch/_cluster/pending_tasks 36 | /elasticsearch/_cat 37 | /elasticsearch/_cat/count 38 | /elasticsearch/_cat/master 39 | /elasticsearch/_cat/nodes 40 | /elasticsearch/_cat/plugins 41 | /elasticsearch/_cat/repositories 42 | /elasticsearch/_cat/tasks 43 | /elasticsearch/_cat/aliases 44 | /elasticsearch/_cat/allocation 45 | /elasticsearch/_cat/health 46 | /elasticsearch/_nodes 47 | /elasticsearch/_nodes/stats 48 | /elasticsearch/_nodes/dr-bSDj2Qgq82-9-wXyFSw 49 | /elasticsearch/_nodes/dr-bSDj2Qgq82-9-wXyFSw/stats 50 | /elasticsearch/index1 51 | /elasticsearch/index1/_field_stats 52 | /elasticsearch/index1/_mapping 53 | /elasticsearch/index1/_stats 54 | /elasticsearch/index1/type1 55 | /elasticsearch/index1/type1/_mapping 56 | ``` 57 | 58 | ## Build 59 | 60 | ``` 61 | $ go get github.com/dutchcoders/elasticofs 62 | $ go build -o /usr/bin/elasticofs 63 | ``` 64 | 65 | ## Installation 66 | 67 | ``` 68 | $ ln -s /usr/bin/elasticofs /usr/sbin/mount.elasticofs 69 | ``` 70 | 71 | ## Mount 72 | 73 | ``` 74 | $ mount -t elasticofs -o gid=0,uid=0 http://127.0.0.1:9000/ /elasticsearch 75 | ``` 76 | 77 | ## Unmount 78 | 79 | ``` 80 | $ umount /elasticsearch 81 | ``` 82 | 83 | ## Options 84 | 85 | * **GID**: The default gid to assign for files from storage. 86 | * **UID**: The default gid to assign for files from storage. 87 | 88 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/datastore/metadata.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package datastore 6 | 7 | import "golang.org/x/net/context" 8 | 9 | // Datastore kinds for the metadata entities. 10 | const ( 11 | namespaceKind = "__namespace__" 12 | kindKind = "__kind__" 13 | propertyKind = "__property__" 14 | entityGroupKind = "__entitygroup__" 15 | ) 16 | 17 | // Namespaces returns all the datastore namespaces. 18 | func Namespaces(ctx context.Context) ([]string, error) { 19 | // TODO(djd): Support range queries. 20 | q := NewQuery(namespaceKind).KeysOnly() 21 | keys, err := q.GetAll(ctx, nil) 22 | if err != nil { 23 | return nil, err 24 | } 25 | // The empty namespace key uses a numeric ID (==1), but luckily 26 | // the string ID defaults to "" for numeric IDs anyway. 27 | return keyNames(keys), nil 28 | } 29 | 30 | // Kinds returns the names of all the kinds in the current namespace. 31 | func Kinds(ctx context.Context) ([]string, error) { 32 | // TODO(djd): Support range queries. 33 | q := NewQuery(kindKind).KeysOnly() 34 | keys, err := q.GetAll(ctx, nil) 35 | if err != nil { 36 | return nil, err 37 | } 38 | return keyNames(keys), nil 39 | } 40 | 41 | // keyNames returns a slice of the provided keys' names (string IDs). 42 | func keyNames(keys []*Key) []string { 43 | n := make([]string, 0, len(keys)) 44 | for _, k := range keys { 45 | n = append(n, k.StringID()) 46 | } 47 | return n 48 | } 49 | 50 | // KindProperties returns all the indexed properties for the given kind. 51 | // The properties are returned as a map of property names to a slice of the 52 | // representation types. The representation types for the supported Go property 53 | // types are: 54 | // "INT64": signed integers and time.Time 55 | // "DOUBLE": float32 and float64 56 | // "BOOLEAN": bool 57 | // "STRING": string, []byte and ByteString 58 | // "POINT": appengine.GeoPoint 59 | // "REFERENCE": *Key 60 | // "USER": (not used in the Go runtime) 61 | func KindProperties(ctx context.Context, kind string) (map[string][]string, error) { 62 | // TODO(djd): Support range queries. 63 | kindKey := NewKey(ctx, kindKind, kind, 0, nil) 64 | q := NewQuery(propertyKind).Ancestor(kindKey) 65 | 66 | propMap := map[string][]string{} 67 | props := []struct { 68 | Repr []string `datastore:property_representation` 69 | }{} 70 | 71 | keys, err := q.GetAll(ctx, &props) 72 | if err != nil { 73 | return nil, err 74 | } 75 | for i, p := range props { 76 | propMap[keys[i].StringID()] = p.Repr 77 | } 78 | return propMap, nil 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/minio/minio-go/api-datatypes.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Minio Go Library for Amazon S3 Compatible Cloud Storage (C) 2015 Minio, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package minio 18 | 19 | import "time" 20 | 21 | // BucketInfo container for bucket metadata. 22 | type BucketInfo struct { 23 | // The name of the bucket. 24 | Name string `json:"name"` 25 | // Date the bucket was created. 26 | CreationDate time.Time `json:"creationDate"` 27 | } 28 | 29 | // ObjectInfo container for object metadata. 30 | type ObjectInfo struct { 31 | // An ETag is optionally set to md5sum of an object. In case of multipart objects, 32 | // ETag is of the form MD5SUM-N where MD5SUM is md5sum of all individual md5sums of 33 | // each parts concatenated into one string. 34 | ETag string `json:"etag"` 35 | 36 | Key string `json:"name"` // Name of the object 37 | LastModified time.Time `json:"lastModified"` // Date and time the object was last modified. 38 | Size int64 `json:"size"` // Size in bytes of the object. 39 | ContentType string `json:"contentType"` // A standard MIME type describing the format of the object data. 40 | 41 | // Owner name. 42 | Owner struct { 43 | DisplayName string `json:"name"` 44 | ID string `json:"id"` 45 | } `json:"owner"` 46 | 47 | // The class of storage used to store the object. 48 | StorageClass string `json:"storageClass"` 49 | 50 | // Error 51 | Err error `json:"-"` 52 | } 53 | 54 | // ObjectMultipartInfo container for multipart object metadata. 55 | type ObjectMultipartInfo struct { 56 | // Date and time at which the multipart upload was initiated. 57 | Initiated time.Time `type:"timestamp" timestampFormat:"iso8601"` 58 | 59 | Initiator initiator 60 | Owner owner 61 | 62 | // The type of storage to use for the object. Defaults to 'STANDARD'. 63 | StorageClass string 64 | 65 | // Key of the object for which the multipart upload was initiated. 66 | Key string 67 | 68 | // Size in bytes of the object. 69 | Size int64 70 | 71 | // Upload ID that identifies the multipart upload. 72 | UploadID string `xml:"UploadId"` 73 | 74 | // Error 75 | Err error 76 | } 77 | -------------------------------------------------------------------------------- /fs/config.go: -------------------------------------------------------------------------------- 1 | /* 2 | * ElasticoFS 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package fs 18 | 19 | import ( 20 | "errors" 21 | "os" 22 | ) 23 | 24 | // Config is being used for storge of configuration items 25 | type Config struct { 26 | bucket string 27 | cache string 28 | cacheSize uint64 29 | accountID string 30 | target string 31 | mountpoint string 32 | debug bool 33 | 34 | uid uint32 35 | gid uint32 36 | mode os.FileMode 37 | } 38 | 39 | // Bucket option for Config 40 | func Bucket(name string) func(*Config) { 41 | return func(cfg *Config) { 42 | cfg.bucket = name 43 | } 44 | } 45 | 46 | func Mountpoint(mountpoint string) func(*Config) { 47 | return func(cfg *Config) { 48 | cfg.mountpoint = mountpoint 49 | } 50 | } 51 | 52 | // Bucket option for Config 53 | func Target(target string) func(*Config) { 54 | return func(cfg *Config) { 55 | cfg.target = target 56 | } 57 | } 58 | 59 | // Bucket option for Config 60 | func CacheDir(path string) func(*Config) { 61 | return func(cfg *Config) { 62 | cfg.cache = path 63 | } 64 | } 65 | 66 | // Bucket option for Config 67 | func CacheSize(size uint64) func(*Config) { 68 | return func(cfg *Config) { 69 | cfg.cacheSize = size 70 | } 71 | } 72 | 73 | // Bucket option for Config 74 | func Gid(gid uint32) func(*Config) { 75 | return func(cfg *Config) { 76 | cfg.gid = gid 77 | } 78 | } 79 | 80 | // Bucket option for Config 81 | func Uid(uid uint32) func(*Config) { 82 | return func(cfg *Config) { 83 | cfg.uid = uid 84 | } 85 | } 86 | 87 | // Bucket option for Config 88 | func AccountID(accountID string) func(*Config) { 89 | return func(cfg *Config) { 90 | cfg.accountID = accountID 91 | } 92 | } 93 | 94 | func Debug() func(*Config) { 95 | return func(cfg *Config) { 96 | cfg.debug = true 97 | } 98 | } 99 | 100 | func (cfg *Config) validate() error { 101 | // check if mountpoint exists 102 | if cfg.mountpoint == "" { 103 | return errors.New("Mountpoint not set") 104 | } 105 | 106 | /* 107 | if cfg.bucket == "" { 108 | return errors.New("Bucket not set") 109 | } 110 | */ 111 | 112 | return nil 113 | } 114 | -------------------------------------------------------------------------------- /vendor/github.com/minio/minio-go/api-get-policy.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Minio Go Library for Amazon S3 Compatible Cloud Storage (C) 2015, 2016 Minio, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package minio 18 | 19 | import ( 20 | "encoding/json" 21 | "io/ioutil" 22 | "net/http" 23 | "net/url" 24 | 25 | "github.com/minio/minio-go/pkg/policy" 26 | ) 27 | 28 | // GetBucketPolicy - get bucket policy at a given path. 29 | func (c Client) GetBucketPolicy(bucketName, objectPrefix string) (bucketPolicy policy.BucketPolicy, err error) { 30 | // Input validation. 31 | if err := isValidBucketName(bucketName); err != nil { 32 | return policy.BucketPolicyNone, err 33 | } 34 | if err := isValidObjectPrefix(objectPrefix); err != nil { 35 | return policy.BucketPolicyNone, err 36 | } 37 | policyInfo, err := c.getBucketPolicy(bucketName, objectPrefix) 38 | if err != nil { 39 | return policy.BucketPolicyNone, err 40 | } 41 | return policy.GetPolicy(policyInfo.Statements, bucketName, objectPrefix), nil 42 | } 43 | 44 | // Request server for policy. 45 | func (c Client) getBucketPolicy(bucketName string, objectPrefix string) (policy.BucketAccessPolicy, error) { 46 | // Get resources properly escaped and lined up before 47 | // using them in http request. 48 | urlValues := make(url.Values) 49 | urlValues.Set("policy", "") 50 | 51 | // Execute GET on bucket to list objects. 52 | resp, err := c.executeMethod("GET", requestMetadata{ 53 | bucketName: bucketName, 54 | queryValues: urlValues, 55 | }) 56 | 57 | defer closeResponse(resp) 58 | if err != nil { 59 | return policy.BucketAccessPolicy{}, err 60 | } 61 | 62 | if resp != nil { 63 | if resp.StatusCode != http.StatusOK { 64 | errResponse := httpRespToErrorResponse(resp, bucketName, "") 65 | if ToErrorResponse(errResponse).Code == "NoSuchBucketPolicy" { 66 | return policy.BucketAccessPolicy{Version: "2012-10-17"}, nil 67 | } 68 | return policy.BucketAccessPolicy{}, errResponse 69 | } 70 | } 71 | bucketPolicyBuf, err := ioutil.ReadAll(resp.Body) 72 | if err != nil { 73 | return policy.BucketAccessPolicy{}, err 74 | } 75 | 76 | policy := policy.BucketAccessPolicy{} 77 | err = json.Unmarshal(bucketPolicyBuf, &policy) 78 | return policy, err 79 | } 80 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/identity_vm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | 7 | package internal 8 | 9 | import ( 10 | "net/http" 11 | "os" 12 | 13 | netcontext "golang.org/x/net/context" 14 | ) 15 | 16 | // These functions are implementations of the wrapper functions 17 | // in ../appengine/identity.go. See that file for commentary. 18 | 19 | const ( 20 | hDefaultVersionHostname = "X-AppEngine-Default-Version-Hostname" 21 | hRequestLogId = "X-AppEngine-Request-Log-Id" 22 | hDatacenter = "X-AppEngine-Datacenter" 23 | ) 24 | 25 | func ctxHeaders(ctx netcontext.Context) http.Header { 26 | return fromContext(ctx).Request().Header 27 | } 28 | 29 | func DefaultVersionHostname(ctx netcontext.Context) string { 30 | return ctxHeaders(ctx).Get(hDefaultVersionHostname) 31 | } 32 | 33 | func RequestID(ctx netcontext.Context) string { 34 | return ctxHeaders(ctx).Get(hRequestLogId) 35 | } 36 | 37 | func Datacenter(ctx netcontext.Context) string { 38 | return ctxHeaders(ctx).Get(hDatacenter) 39 | } 40 | 41 | func ServerSoftware() string { 42 | // TODO(dsymonds): Remove fallback when we've verified this. 43 | if s := os.Getenv("SERVER_SOFTWARE"); s != "" { 44 | return s 45 | } 46 | return "Google App Engine/1.x.x" 47 | } 48 | 49 | // TODO(dsymonds): Remove the metadata fetches. 50 | 51 | func ModuleName(_ netcontext.Context) string { 52 | if s := os.Getenv("GAE_MODULE_NAME"); s != "" { 53 | return s 54 | } 55 | return string(mustGetMetadata("instance/attributes/gae_backend_name")) 56 | } 57 | 58 | func VersionID(_ netcontext.Context) string { 59 | if s1, s2 := os.Getenv("GAE_MODULE_VERSION"), os.Getenv("GAE_MINOR_VERSION"); s1 != "" && s2 != "" { 60 | return s1 + "." + s2 61 | } 62 | return string(mustGetMetadata("instance/attributes/gae_backend_version")) + "." + string(mustGetMetadata("instance/attributes/gae_backend_minor_version")) 63 | } 64 | 65 | func InstanceID() string { 66 | if s := os.Getenv("GAE_MODULE_INSTANCE"); s != "" { 67 | return s 68 | } 69 | return string(mustGetMetadata("instance/attributes/gae_backend_instance")) 70 | } 71 | 72 | func partitionlessAppID() string { 73 | // gae_project has everything except the partition prefix. 74 | appID := os.Getenv("GAE_LONG_APP_ID") 75 | if appID == "" { 76 | appID = string(mustGetMetadata("instance/attributes/gae_project")) 77 | } 78 | return appID 79 | } 80 | 81 | func fullyQualifiedAppID(_ netcontext.Context) string { 82 | appID := partitionlessAppID() 83 | 84 | part := os.Getenv("GAE_PARTITION") 85 | if part == "" { 86 | part = string(mustGetMetadata("instance/attributes/gae_partition")) 87 | } 88 | 89 | if part != "" { 90 | appID = part + "~" + appID 91 | } 92 | return appID 93 | } 94 | 95 | func IsDevAppServer() bool { 96 | return os.Getenv("RUN_WITH_DEVAPPSERVER") != "" 97 | } 98 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Package unix contains an interface to the low-level operating system 8 | // primitives. OS details vary depending on the underlying system, and 9 | // by default, godoc will display OS-specific documentation for the current 10 | // system. If you want godoc to display OS documentation for another 11 | // system, set $GOOS and $GOARCH to the desired system. For example, if 12 | // you want to view documentation for freebsd/arm on linux/amd64, set $GOOS 13 | // to freebsd and $GOARCH to arm. 14 | // The primary use of this package is inside other packages that provide a more 15 | // portable interface to the system, such as "os", "time" and "net". Use 16 | // those packages rather than this one if you can. 17 | // For details of the functions and data types in this package consult 18 | // the manuals for the appropriate operating system. 19 | // These calls return err == nil to indicate success; otherwise 20 | // err represents an operating system error describing the failure and 21 | // holds a value of type syscall.Errno. 22 | package unix // import "golang.org/x/sys/unix" 23 | 24 | import "unsafe" 25 | 26 | // ByteSliceFromString returns a NUL-terminated slice of bytes 27 | // containing the text of s. If s contains a NUL byte at any 28 | // location, it returns (nil, EINVAL). 29 | func ByteSliceFromString(s string) ([]byte, error) { 30 | for i := 0; i < len(s); i++ { 31 | if s[i] == 0 { 32 | return nil, EINVAL 33 | } 34 | } 35 | a := make([]byte, len(s)+1) 36 | copy(a, s) 37 | return a, nil 38 | } 39 | 40 | // BytePtrFromString returns a pointer to a NUL-terminated array of 41 | // bytes containing the text of s. If s contains a NUL byte at any 42 | // location, it returns (nil, EINVAL). 43 | func BytePtrFromString(s string) (*byte, error) { 44 | a, err := ByteSliceFromString(s) 45 | if err != nil { 46 | return nil, err 47 | } 48 | return &a[0], nil 49 | } 50 | 51 | // Single-word zero for use when we need a valid pointer to 0 bytes. 52 | // See mkunix.pl. 53 | var _zero uintptr 54 | 55 | func (ts *Timespec) Unix() (sec int64, nsec int64) { 56 | return int64(ts.Sec), int64(ts.Nsec) 57 | } 58 | 59 | func (tv *Timeval) Unix() (sec int64, nsec int64) { 60 | return int64(tv.Sec), int64(tv.Usec) * 1000 61 | } 62 | 63 | func (ts *Timespec) Nano() int64 { 64 | return int64(ts.Sec)*1e9 + int64(ts.Nsec) 65 | } 66 | 67 | func (tv *Timeval) Nano() int64 { 68 | return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000 69 | } 70 | 71 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 72 | 73 | // use is a no-op, but the compiler cannot see that it is. 74 | // Calling use(p) ensures that p is kept live until that point. 75 | //go:noescape 76 | func use(p unsafe.Pointer) 77 | -------------------------------------------------------------------------------- /vendor/github.com/minio/minio-go/copy-conditions.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Minio Go Library for Amazon S3 Compatible Cloud Storage (C) 2016 Minio, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package minio 18 | 19 | import ( 20 | "net/http" 21 | "time" 22 | ) 23 | 24 | // copyCondition explanation: 25 | // http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectCOPY.html 26 | // 27 | // Example: 28 | // 29 | // copyCondition { 30 | // key: "x-amz-copy-if-modified-since", 31 | // value: "Tue, 15 Nov 1994 12:45:26 GMT", 32 | // } 33 | // 34 | type copyCondition struct { 35 | key string 36 | value string 37 | } 38 | 39 | // CopyConditions - copy conditions. 40 | type CopyConditions struct { 41 | conditions []copyCondition 42 | } 43 | 44 | // NewCopyConditions - Instantiate new list of conditions. 45 | func NewCopyConditions() CopyConditions { 46 | return CopyConditions{ 47 | conditions: make([]copyCondition, 0), 48 | } 49 | } 50 | 51 | // SetMatchETag - set match etag. 52 | func (c *CopyConditions) SetMatchETag(etag string) error { 53 | if etag == "" { 54 | return ErrInvalidArgument("ETag cannot be empty.") 55 | } 56 | c.conditions = append(c.conditions, copyCondition{ 57 | key: "x-amz-copy-source-if-match", 58 | value: etag, 59 | }) 60 | return nil 61 | } 62 | 63 | // SetMatchETagExcept - set match etag except. 64 | func (c *CopyConditions) SetMatchETagExcept(etag string) error { 65 | if etag == "" { 66 | return ErrInvalidArgument("ETag cannot be empty.") 67 | } 68 | c.conditions = append(c.conditions, copyCondition{ 69 | key: "x-amz-copy-source-if-none-match", 70 | value: etag, 71 | }) 72 | return nil 73 | } 74 | 75 | // SetUnmodified - set unmodified time since. 76 | func (c *CopyConditions) SetUnmodified(modTime time.Time) error { 77 | if modTime.IsZero() { 78 | return ErrInvalidArgument("Modified since cannot be empty.") 79 | } 80 | c.conditions = append(c.conditions, copyCondition{ 81 | key: "x-amz-copy-source-if-unmodified-since", 82 | value: modTime.Format(http.TimeFormat), 83 | }) 84 | return nil 85 | } 86 | 87 | // SetModified - set modified time since. 88 | func (c *CopyConditions) SetModified(modTime time.Time) error { 89 | if modTime.IsZero() { 90 | return ErrInvalidArgument("Modified since cannot be empty.") 91 | } 92 | c.conditions = append(c.conditions, copyCondition{ 93 | key: "x-amz-copy-source-if-modified-since", 94 | value: modTime.Format(http.TimeFormat), 95 | }) 96 | return nil 97 | } 98 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/errors.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import "errors" 4 | 5 | // These errors can be returned when opening or calling methods on a DB. 6 | var ( 7 | // ErrDatabaseNotOpen is returned when a DB instance is accessed before it 8 | // is opened or after it is closed. 9 | ErrDatabaseNotOpen = errors.New("database not open") 10 | 11 | // ErrDatabaseOpen is returned when opening a database that is 12 | // already open. 13 | ErrDatabaseOpen = errors.New("database already open") 14 | 15 | // ErrInvalid is returned when both meta pages on a database are invalid. 16 | // This typically occurs when a file is not a bolt database. 17 | ErrInvalid = errors.New("invalid database") 18 | 19 | // ErrVersionMismatch is returned when the data file was created with a 20 | // different version of Bolt. 21 | ErrVersionMismatch = errors.New("version mismatch") 22 | 23 | // ErrChecksum is returned when either meta page checksum does not match. 24 | ErrChecksum = errors.New("checksum error") 25 | 26 | // ErrTimeout is returned when a database cannot obtain an exclusive lock 27 | // on the data file after the timeout passed to Open(). 28 | ErrTimeout = errors.New("timeout") 29 | ) 30 | 31 | // These errors can occur when beginning or committing a Tx. 32 | var ( 33 | // ErrTxNotWritable is returned when performing a write operation on a 34 | // read-only transaction. 35 | ErrTxNotWritable = errors.New("tx not writable") 36 | 37 | // ErrTxClosed is returned when committing or rolling back a transaction 38 | // that has already been committed or rolled back. 39 | ErrTxClosed = errors.New("tx closed") 40 | 41 | // ErrDatabaseReadOnly is returned when a mutating transaction is started on a 42 | // read-only database. 43 | ErrDatabaseReadOnly = errors.New("database is in read-only mode") 44 | ) 45 | 46 | // These errors can occur when putting or deleting a value or a bucket. 47 | var ( 48 | // ErrBucketNotFound is returned when trying to access a bucket that has 49 | // not been created yet. 50 | ErrBucketNotFound = errors.New("bucket not found") 51 | 52 | // ErrBucketExists is returned when creating a bucket that already exists. 53 | ErrBucketExists = errors.New("bucket already exists") 54 | 55 | // ErrBucketNameRequired is returned when creating a bucket with a blank name. 56 | ErrBucketNameRequired = errors.New("bucket name required") 57 | 58 | // ErrKeyRequired is returned when inserting a zero-length key. 59 | ErrKeyRequired = errors.New("key required") 60 | 61 | // ErrKeyTooLarge is returned when inserting a key that is larger than MaxKeySize. 62 | ErrKeyTooLarge = errors.New("key too large") 63 | 64 | // ErrValueTooLarge is returned when inserting a value that is larger than MaxValueSize. 65 | ErrValueTooLarge = errors.New("value too large") 66 | 67 | // ErrIncompatibleValue is returned when trying create or delete a bucket 68 | // on an existing non-bucket key or when trying to create or delete a 69 | // non-bucket key on an existing bucket key. 70 | ErrIncompatibleValue = errors.New("incompatible value") 71 | ) 72 | -------------------------------------------------------------------------------- /vendor/gopkg.in/vmihailenco/msgpack.v2/encode_slice.go: -------------------------------------------------------------------------------- 1 | package msgpack 2 | 3 | import ( 4 | "reflect" 5 | 6 | "gopkg.in/vmihailenco/msgpack.v2/codes" 7 | ) 8 | 9 | func encodeStringValue(e *Encoder, v reflect.Value) error { 10 | return e.EncodeString(v.String()) 11 | } 12 | 13 | func encodeByteSliceValue(e *Encoder, v reflect.Value) error { 14 | return e.EncodeBytes(v.Bytes()) 15 | } 16 | 17 | func encodeByteArrayValue(e *Encoder, v reflect.Value) error { 18 | if err := e.encodeBytesLen(v.Len()); err != nil { 19 | return err 20 | } 21 | 22 | if v.CanAddr() { 23 | b := v.Slice(0, v.Len()).Bytes() 24 | return e.write(b) 25 | } 26 | 27 | b := make([]byte, v.Len()) 28 | reflect.Copy(reflect.ValueOf(b), v) 29 | return e.write(b) 30 | } 31 | 32 | func (e *Encoder) encodeBytesLen(l int) error { 33 | if l < 256 { 34 | return e.write1(codes.Bin8, uint64(l)) 35 | } 36 | if l < 65536 { 37 | return e.write2(codes.Bin16, uint64(l)) 38 | } 39 | return e.write4(codes.Bin32, uint64(l)) 40 | } 41 | 42 | func (e *Encoder) encodeStrLen(l int) error { 43 | if l < 32 { 44 | return e.w.WriteByte(codes.FixedStrLow | uint8(l)) 45 | } 46 | if l < 256 { 47 | return e.write1(codes.Str8, uint64(l)) 48 | } 49 | if l < 65536 { 50 | return e.write2(codes.Str16, uint64(l)) 51 | } 52 | return e.write4(codes.Str32, uint64(l)) 53 | } 54 | 55 | func (e *Encoder) EncodeString(v string) error { 56 | if err := e.encodeStrLen(len(v)); err != nil { 57 | return err 58 | } 59 | return e.writeString(v) 60 | } 61 | 62 | func (e *Encoder) EncodeBytes(v []byte) error { 63 | if v == nil { 64 | return e.EncodeNil() 65 | } 66 | if err := e.encodeBytesLen(len(v)); err != nil { 67 | return err 68 | } 69 | return e.write(v) 70 | } 71 | 72 | func (e *Encoder) EncodeArrayLen(l int) error { 73 | if l < 16 { 74 | return e.w.WriteByte(codes.FixedArrayLow | byte(l)) 75 | } 76 | if l < 65536 { 77 | return e.write2(codes.Array16, uint64(l)) 78 | } 79 | return e.write4(codes.Array32, uint64(l)) 80 | } 81 | 82 | // Deprecated. Use EncodeArrayLen instead. 83 | func (e *Encoder) EncodeSliceLen(l int) error { 84 | return e.EncodeArrayLen(l) 85 | } 86 | 87 | func (e *Encoder) encodeStringSlice(s []string) error { 88 | if s == nil { 89 | return e.EncodeNil() 90 | } 91 | if err := e.EncodeArrayLen(len(s)); err != nil { 92 | return err 93 | } 94 | for _, v := range s { 95 | if err := e.EncodeString(v); err != nil { 96 | return err 97 | } 98 | } 99 | return nil 100 | } 101 | 102 | func encodeSliceValue(e *Encoder, v reflect.Value) error { 103 | if v.IsNil() { 104 | return e.EncodeNil() 105 | } 106 | return encodeArrayValue(e, v) 107 | } 108 | 109 | func encodeArrayValue(e *Encoder, v reflect.Value) error { 110 | l := v.Len() 111 | if err := e.EncodeSliceLen(l); err != nil { 112 | return err 113 | } 114 | for i := 0; i < l; i++ { 115 | if err := e.EncodeValue(v.Index(i)); err != nil { 116 | return err 117 | } 118 | } 119 | return nil 120 | } 121 | -------------------------------------------------------------------------------- /vendor/github.com/op/go-logging/log_nix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | // Copyright 2013, Örjan Persson. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package logging 8 | 9 | import ( 10 | "bytes" 11 | "fmt" 12 | "io" 13 | "log" 14 | ) 15 | 16 | type color int 17 | 18 | const ( 19 | ColorBlack = iota + 30 20 | ColorRed 21 | ColorGreen 22 | ColorYellow 23 | ColorBlue 24 | ColorMagenta 25 | ColorCyan 26 | ColorWhite 27 | ) 28 | 29 | var ( 30 | colors = []string{ 31 | CRITICAL: ColorSeq(ColorMagenta), 32 | ERROR: ColorSeq(ColorRed), 33 | WARNING: ColorSeq(ColorYellow), 34 | NOTICE: ColorSeq(ColorGreen), 35 | DEBUG: ColorSeq(ColorCyan), 36 | } 37 | boldcolors = []string{ 38 | CRITICAL: ColorSeqBold(ColorMagenta), 39 | ERROR: ColorSeqBold(ColorRed), 40 | WARNING: ColorSeqBold(ColorYellow), 41 | NOTICE: ColorSeqBold(ColorGreen), 42 | DEBUG: ColorSeqBold(ColorCyan), 43 | } 44 | ) 45 | 46 | // LogBackend utilizes the standard log module. 47 | type LogBackend struct { 48 | Logger *log.Logger 49 | Color bool 50 | ColorConfig []string 51 | } 52 | 53 | // NewLogBackend creates a new LogBackend. 54 | func NewLogBackend(out io.Writer, prefix string, flag int) *LogBackend { 55 | return &LogBackend{Logger: log.New(out, prefix, flag)} 56 | } 57 | 58 | // Log implements the Backend interface. 59 | func (b *LogBackend) Log(level Level, calldepth int, rec *Record) error { 60 | if b.Color { 61 | col := colors[level] 62 | if len(b.ColorConfig) > int(level) && b.ColorConfig[level] != "" { 63 | col = b.ColorConfig[level] 64 | } 65 | 66 | buf := &bytes.Buffer{} 67 | buf.Write([]byte(col)) 68 | buf.Write([]byte(rec.Formatted(calldepth + 1))) 69 | buf.Write([]byte("\033[0m")) 70 | // For some reason, the Go logger arbitrarily decided "2" was the correct 71 | // call depth... 72 | return b.Logger.Output(calldepth+2, buf.String()) 73 | } 74 | 75 | return b.Logger.Output(calldepth+2, rec.Formatted(calldepth+1)) 76 | } 77 | 78 | // ConvertColors takes a list of ints representing colors for log levels and 79 | // converts them into strings for ANSI color formatting 80 | func ConvertColors(colors []int, bold bool) []string { 81 | converted := []string{} 82 | for _, i := range colors { 83 | if bold { 84 | converted = append(converted, ColorSeqBold(color(i))) 85 | } else { 86 | converted = append(converted, ColorSeq(color(i))) 87 | } 88 | } 89 | 90 | return converted 91 | } 92 | 93 | func ColorSeq(color color) string { 94 | return fmt.Sprintf("\033[%dm", int(color)) 95 | } 96 | 97 | func ColorSeqBold(color color) string { 98 | return fmt.Sprintf("\033[%d;1m", int(color)) 99 | } 100 | 101 | func doFmtVerbLevelColor(layout string, level Level, output io.Writer) { 102 | if layout == "bold" { 103 | output.Write([]byte(boldcolors[level])) 104 | } else if layout == "reset" { 105 | output.Write([]byte("\033[0m")) 106 | } else { 107 | output.Write([]byte(colors[level])) 108 | } 109 | } 110 | --------------------------------------------------------------------------------