Documentation
¶
Index ¶
- Constants
- Variables
- func AddMirror(serverAddr string)
- func ConfigureFromViper()
- func ConfigureImageStoreFromViper()
- func InfoHandler(w http.ResponseWriter, req *http.Request)
- func MakeRootNode(fs FileSystem, root string)
- func MungeHostname(hostname string) []string
- func RecursiveMkdir(dir string)
- func RegisterDefaultHandlers()
- func RootHandler(w http.ResponseWriter, req *http.Request)
- func ViperConfiguration()
- type DirListing
- type DirMapStore
- type FileOverlayFS
- type FileSystem
- type GoogleImageStore
- func (store GoogleImageStore) Has(key string) bool
- func (store GoogleImageStore) Retrieve(key string) (io.Reader, error)
- func (store GoogleImageStore) Statistics() interface{}
- func (store GoogleImageStore) Store(key string, data io.Reader)
- func (store *GoogleImageStore) Url(key string) (string, bool)
- type HttpFS
- type ImageStore
- type LocalFS
- type LocalImageStore
- func (store *LocalImageStore) Has(key string) bool
- func (store LocalImageStore) Retrieve(key string) (io.Reader, error)
- func (store LocalImageStore) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (store LocalImageStore) Statistics() interface{}
- func (store *LocalImageStore) Store(key string, data io.Reader)
- func (store *LocalImageStore) Url(key string) (string, bool)
- type MoovHandlerTiming
- type Node
- func CacheHandler(node *Node, path []string, w http.ResponseWriter, req *http.Request) *Node
- func HandleDirectory(node *Node, path []string, w http.ResponseWriter, req *http.Request) *Node
- func MoovHandler(node *Node, path []string, w http.ResponseWriter, req *http.Request) *Node
- func RedirectHandler(node *Node, path []string, w http.ResponseWriter, req *http.Request) *Node
- type NullImageStore
- type QTEntry
- type QTStore
- type RootNode
Constants ¶
View Source
const ( Directory = iota File = iota )
View Source
const ApiVersion = "v1"
View Source
const CachedExpiration = 5 * time.Minute
a Duration, measured in nanoseconds
View Source
const Version = "v0.1.0"
Variables ¶
View Source
var ( PromCacheRequests = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "cache_requests_total", Help: "Number of cache requests.", }, []string{"store"}, ) PromCacheMisses = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "cache_misses_total", Help: "Number of cache misses.", }, []string{"store"}, ) PromCacheSize = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "cache_size", Help: "Number of elements in cache", }, []string{"store"}, ) )
View Source
var Logger kitlog.Logger
View Source
var RootMap map[string]*RootNode
Functions ¶
func ConfigureFromViper ¶
func ConfigureFromViper()
func ConfigureImageStoreFromViper ¶
func ConfigureImageStoreFromViper()
func InfoHandler ¶
func InfoHandler(w http.ResponseWriter, req *http.Request)
func MakeRootNode ¶
func MakeRootNode(fs FileSystem, root string)
func MungeHostname ¶
func RecursiveMkdir ¶
func RecursiveMkdir(dir string)
func RegisterDefaultHandlers ¶
func RegisterDefaultHandlers()
func RootHandler ¶
func RootHandler(w http.ResponseWriter, req *http.Request)
RootHandler is the default HTTP handler, registered at "/" It returns a JSON structure giving the relative path to each of the registered mirrors.
e.g.
{ "https://rawdata.oceanobservatories.org/files/": { "APIPath": { "V1": "/v1/org/oceanobservatories/rawdata/files/" } } }
func ViperConfiguration ¶
func ViperConfiguration()
Types ¶
type DirListing ¶
type DirMapStore ¶
type DirMapStore struct { Cache map[string](*DirListing) Mutex sync.Mutex }
var DirCache DirMapStore
type FileOverlayFS ¶
type FileOverlayFS struct { Flatten bool // contains filtered or unexported fields }
func OpenFileOverlayFS ¶
func OpenFileOverlayFS(fs FileSystem, path string) (*FileOverlayFS, error)
func (*FileOverlayFS) FileSource ¶
func (fs *FileOverlayFS) FileSource(p string) (lazyfs.FileSource, error)
func (*FileOverlayFS) OriginalPath ¶
func (fs *FileOverlayFS) OriginalPath(p string) string
func (*FileOverlayFS) PathType ¶
func (fs *FileOverlayFS) PathType(path string) int
func (*FileOverlayFS) ReadDir ¶
func (fs *FileOverlayFS) ReadDir(p string) (*DirListing, error)
type FileSystem ¶
type GoogleImageStore ¶
type GoogleImageStore struct { Stats struct { // contains filtered or unexported fields } // contains filtered or unexported fields }
func CreateGoogleStore ¶
func CreateGoogleStore(bucket string) *GoogleImageStore
func (GoogleImageStore) Has ¶
func (store GoogleImageStore) Has(key string) bool
func (GoogleImageStore) Retrieve ¶
func (store GoogleImageStore) Retrieve(key string) (io.Reader, error)
func (GoogleImageStore) Statistics ¶
func (store GoogleImageStore) Statistics() interface{}
type ImageStore ¶
type ImageStore interface { Has(key string) bool Url(key string) (string, bool) Store(key string, data io.Reader) Retrieve(key string) (io.Reader, error) }
var ImageCache ImageStore = NullImageStore{}
type LocalFS ¶
type LocalFS struct {
Path string
}
func OpenLocalFS ¶
func (*LocalFS) OriginalPath ¶
type LocalImageStore ¶
type LocalImageStore struct { LocalRoot string UrlRoot string Stats struct { // contains filtered or unexported fields } // contains filtered or unexported fields }
func CreateLocalStore ¶
func CreateLocalStore(localRoot string, addr string) *LocalImageStore
func (*LocalImageStore) Has ¶
func (store *LocalImageStore) Has(key string) bool
func (LocalImageStore) Retrieve ¶
func (store LocalImageStore) Retrieve(key string) (io.Reader, error)
func (LocalImageStore) ServeHTTP ¶
func (store LocalImageStore) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (LocalImageStore) Statistics ¶
func (store LocalImageStore) Statistics() interface{}
type MoovHandlerTiming ¶
type MoovHandlerTiming struct {
Handler, Metadata, Extraction, Encode time.Duration
// contains filtered or unexported fields
}
MoovHandlerTiming
type Node ¶
type Node struct { Path string Children map[string]*Node Fs FileSystem // contains filtered or unexported fields }
func CacheHandler ¶
Doesn't actually cache yet, just redirects
func HandleDirectory ¶
func MoovHandler ¶
func RedirectHandler ¶
func (*Node) BootstrapDirectory ¶
func (node *Node) BootstrapDirectory(listing DirListing)
type NullImageStore ¶
type NullImageStore struct { }
func (NullImageStore) Has ¶
func (store NullImageStore) Has(key string) bool
Source Files
¶
Click to show internal directories.
Click to hide internal directories.