Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIEndpoint ¶
type APIEndpoint interface { Get(http.ResponseWriter, *http.Request, url.Values) Post(http.ResponseWriter, *http.Request, url.Values) Delete(http.ResponseWriter, *http.Request, url.Values) }
APIEndpoint represents a single route that is can respond to various HTTP methods.
func NewDisplayAPI ¶
func NewDisplayAPI(reports models.ReportStore, projects models.ProjectStore, files FileStore) APIEndpoint
NewDisplayAPI returns a new APIEndpoint capable of returning badge data from shields.io.
func NewProjectAPI ¶
func NewProjectAPI(store models.ProjectStore, log LeveledLogger) APIEndpoint
NewProjectAPI creates the api endpoint that is able to create new projects.
func NewReportAPI ¶
func NewReportAPI(re models.ReportStore, pr models.ProjectStore, fs FileStore, log LeveledLogger) APIEndpoint
NewReportAPI returns an api for storing and retreiving reports
type Action ¶
Action types represent a single http request handler, wearere the last url.Values parameter contains path params.
type FileStore ¶
type FileStore interface { NewFile(string, string) (string, io.WriteCloser, error) FindFile(string) (io.ReadCloser, error) }
FileStore defines an interface that is useful for creating writer that persist files.
type LeveledLogger ¶
type LeveledLogger interface { Infof(string, ...interface{}) Debugf(string, ...interface{}) Warnf(string, ...interface{}) Errorf(string, ...interface{}) }
LeveledLogger is a simple interface for logging messages at different "levels"
type RouteList ¶
type RouteList map[*regexp.Regexp]APIEndpoint
RouteList is map of path expressions and their endpoints; matches an incoming request to a single action.
type Runtime ¶
Runtime defines an interface that is used as the http runtime for the gendry api.
func NewRuntime ¶
func NewRuntime(routes *RouteList, log LeveledLogger) Runtime
NewRuntime returns an initialized runtime using the provided route list.