types

package module
v0.0.0-...-2680ae0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2015 License: MIT Imports: 3 Imported by: 2

README

types

types for GOMedia

Documentation

Overview

The types and wrapper types used in gomedia

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppError

type AppError struct {
	Error   error  `json:"error"`
	Message string `json:"message"`
	Code    int    `json:"errorCode"`
}

AppError is a convience type used to return HTTP status codes and messages from AppHandler wrapped HTTPHandlers

type AppHandler

type AppHandler func(http.ResponseWriter, *http.Request) *AppError

AppHandler is a fun type that is used to enable generic error handling for HTTP handlers

func (AppHandler) ServeHTTP

func (fn AppHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServerHTTP is the way to wrap your HTTP Handlers in generic error handling you just need to return and AppError or nil

type LibraryItem

type LibraryItem struct {
	Name    string      `json:"name"`
	Size    int64       `json:"size"`
	Mode    os.FileMode `json:"mode"`
	ModTime time.Time   `json:"modTime"`
	IsDir   bool        `json:"isDir"`
}

LibraryItem is a struct representation of FileInfo for one file in your file system

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL