SYMBOL INDEX (151 symbols across 37 files) FILE: domain/meta.go type Meta (line 11) | type Meta struct method SetDefaults (line 27) | func (meta *Meta) SetDefaults() { method Validate (line 35) | func (meta Meta) Validate() error { function empty (line 43) | func empty(str string) bool { FILE: domain/meta_test.go function TestMeta_Validate (line 11) | func TestMeta_Validate(suite *testing.T) { function testValidation (line 28) | func testValidation(t *testing.T, validator validatable, expectErr bool,... type validatable (line 48) | type validatable interface FILE: domain/post.go constant ContentLibrary (line 12) | ContentLibrary = "library" constant ContentLink (line 13) | ContentLink = "link" constant ContentVideo (line 14) | ContentVideo = "video" type Post (line 20) | type Post struct method Validate (line 36) | func (post Post) Validate() error { function contains (line 56) | func contains(val string, vals []string) bool { FILE: domain/post_test.go function TestPost_Validate (line 10) | func TestPost_Validate(suite *testing.T) { FILE: domain/user.go type User (line 11) | type User struct method Validate (line 22) | func (user User) Validate() error { method HashSecret (line 36) | func (user *User) HashSecret() error { method CheckSecret (line 46) | func (user User) CheckSecret(password string) bool { FILE: domain/user_test.go function TestUser_CheckSecret (line 11) | func TestUser_CheckSecret(t *testing.T) { function TestUser_Validate (line 26) | func TestUser_Validate(suite *testing.T) { FILE: interfaces/mongo/mongo.go function Connect (line 9) | func Connect(uri string, failFast bool) (*mgo.Database, func(), error) { function doNothing (line 24) | func doNothing() {} FILE: interfaces/mongo/posts.go constant colPosts (line 13) | colPosts = "posts" function NewPostStore (line 16) | func NewPostStore(db *mgo.Database) *PostStore { type PostStore (line 23) | type PostStore struct method Exists (line 28) | func (posts *PostStore) Exists(ctx context.Context, name string) bool { method Get (line 39) | func (posts *PostStore) Get(ctx context.Context, name string) (*domain... method Save (line 55) | func (posts *PostStore) Save(ctx context.Context, post domain.Post) (*... method Delete (line 71) | func (posts *PostStore) Delete(ctx context.Context, name string) (*dom... FILE: interfaces/mongo/users.go constant colUsers (line 13) | colUsers = "users" function NewUserStore (line 16) | func NewUserStore(db *mgo.Database) *UserStore { type UserStore (line 23) | type UserStore struct method Exists (line 29) | func (users *UserStore) Exists(ctx context.Context, name string) bool { method Save (line 40) | func (users *UserStore) Save(ctx context.Context, user domain.User) (*... method FindByName (line 56) | func (users *UserStore) FindByName(ctx context.Context, name string) (... method FindAll (line 72) | func (users *UserStore) FindAll(ctx context.Context, tags []string, li... method Delete (line 90) | func (users *UserStore) Delete(ctx context.Context, name string) (*dom... FILE: interfaces/rest/posts.go function addPostsAPI (line 14) | func addPostsAPI(router *mux.Router, pub postPublication, ret postRetrie... type postController (line 26) | type postController struct method search (line 33) | func (pc *postController) search(wr http.ResponseWriter, req *http.Req... method get (line 43) | func (pc *postController) get(wr http.ResponseWriter, req *http.Reques... method post (line 54) | func (pc *postController) post(wr http.ResponseWriter, req *http.Reque... method delete (line 73) | func (pc *postController) delete(wr http.ResponseWriter, req *http.Req... type postRetriever (line 84) | type postRetriever interface type postPublication (line 89) | type postPublication interface FILE: interfaces/rest/rest.go function New (line 14) | func New(logger logger.Logger, reg registration, ret retriever, postsRet... function notFoundHandler (line 27) | func notFoundHandler(wr http.ResponseWriter, req *http.Request) { function methodNotAllowedHandler (line 31) | func methodNotAllowedHandler(wr http.ResponseWriter, req *http.Request) { FILE: interfaces/rest/users.go function addUsersAPI (line 12) | func addUsersAPI(router *mux.Router, reg registration, ret retriever, lo... type userController (line 24) | type userController struct method get (line 30) | func (uc *userController) get(wr http.ResponseWriter, req *http.Reques... method search (line 41) | func (uc *userController) search(wr http.ResponseWriter, req *http.Req... method post (line 52) | func (uc *userController) post(wr http.ResponseWriter, req *http.Reque... type registration (line 71) | type registration interface type retriever (line 75) | type retriever interface FILE: interfaces/rest/utils.go function respond (line 11) | func respond(wr http.ResponseWriter, status int, v interface{}) { function respondErr (line 19) | func respondErr(wr http.ResponseWriter, err error) { function readRequest (line 27) | func readRequest(req *http.Request, v interface{}) error { type errorLogger (line 35) | type errorLogger interface FILE: interfaces/web/app.go type app (line 8) | type app struct method indexHandler (line 13) | func (app app) indexHandler(wr http.ResponseWriter, req *http.Request) { FILE: interfaces/web/fs.go function newSafeFileSystemServer (line 10) | func newSafeFileSystemServer(lg logger.Logger, root string) http.Handler { type safeFileSystem (line 20) | type safeFileSystem struct method Open (line 26) | func (sfs safeFileSystem) Open(path string) (http.File, error) { FILE: interfaces/web/web.go function New (line 14) | func New(lg logger.Logger, cfg Config) (http.Handler, error) { type Config (line 41) | type Config struct function initTemplate (line 46) | func initTemplate(lg logger.Logger, name, path string) (*template.Templa... FILE: main.go function main (line 21) | func main() { function setupServer (line 57) | func setupServer(cfg config, lg logger.Logger, web http.Handler, rest ht... type config (line 77) | type config struct function loadConfig (line 87) | func loadConfig() config { FILE: pkg/errors/authorization.go constant TypeUnauthorized (line 7) | TypeUnauthorized = "Unauthorized" function Unauthorized (line 12) | func Unauthorized(reason string) error { FILE: pkg/errors/error.go type Error (line 10) | type Error struct method Cause (line 39) | func (err Error) Cause() error { method Error (line 43) | func (err Error) Error() string { method Format (line 52) | func (err Error) Format(st fmt.State, verb rune) { FILE: pkg/errors/errors.go constant TypeUnknown (line 9) | TypeUnknown = "Unknown" function New (line 13) | func New(msg string, args ...interface{}) error { function Type (line 24) | func Type(err error) string { function Wrapf (line 32) | func Wrapf(err error, msg string, args ...interface{}) error { function WithStack (line 43) | func WithStack(err error) error { function Cause (line 58) | func Cause(err error) error { FILE: pkg/errors/resource.go constant TypeResourceNotFound (line 7) | TypeResourceNotFound = "ResourceNotFound" constant TypeResourceConflict (line 8) | TypeResourceConflict = "ResourceConflict" function ResourceNotFound (line 13) | func ResourceNotFound(rType, rID string) error { function Conflict (line 26) | func Conflict(rType, rID string) error { FILE: pkg/errors/stack.go constant depth (line 10) | depth = 32 type stack (line 12) | type stack method Format (line 22) | func (st stack) Format(s fmt.State, verb rune) { type frame (line 40) | type frame struct method Format (line 58) | func (f frame) Format(s fmt.State, verb rune) { function callStack (line 78) | func callStack(skip int) stack { function frameFromPC (line 91) | func frameFromPC(pc uintptr) frame { FILE: pkg/errors/validation.go constant TypeInvalidRequest (line 7) | TypeInvalidRequest = "InvalidRequest" constant TypeMissingField (line 8) | TypeMissingField = "MissingField" constant TypeInvalidValue (line 9) | TypeInvalidValue = "InvalidValue" function Validation (line 13) | func Validation(reason string) error { function InvalidValue (line 25) | func InvalidValue(field string, reason string) error { function MissingField (line 39) | func MissingField(field string) error { FILE: pkg/graceful/graceful.go type LogFunc (line 15) | type LogFunc function NewServer (line 18) | func NewServer(handler http.Handler, timeout time.Duration, signals ...o... type Server (line 29) | type Server struct method Serve (line 41) | func (gss *Server) Serve(l net.Listener) error { method ServeTLS (line 54) | func (gss *Server) ServeTLS(l net.Listener, certFile, keyFile string) ... method ListenAndServe (line 67) | func (gss *Server) ListenAndServe() error { method ListenAndServeTLS (line 81) | func (gss *Server) ListenAndServeTLS(certFile, keyFile string) error { method waitForInterrupt (line 92) | func (gss *Server) waitForInterrupt(ctx context.Context) error { method shutdown (line 110) | func (gss *Server) shutdown() error { FILE: pkg/logger/doc.go type Logger (line 10) | type Logger interface FILE: pkg/logger/logrus.go function New (line 11) | func New(wr io.Writer, level string, format string) Logger { type logrusLogger (line 36) | type logrusLogger struct method WithFields (line 40) | func (ll *logrusLogger) WithFields(fields map[string]interface{}) Logg... FILE: pkg/middlewares/authn.go function WithBasicAuth (line 16) | func WithBasicAuth(lg logger.Logger, next http.Handler, verifier UserVer... function User (line 37) | func User(req *http.Request) (string, bool) { type ctxKey (line 46) | type ctxKey type UserVerifier (line 49) | type UserVerifier interface type UserVerifierFunc (line 54) | type UserVerifierFunc method VerifySecret (line 57) | func (uvf UserVerifierFunc) VerifySecret(ctx context.Context, name, se... FILE: pkg/middlewares/logging.go function WithRequestLogging (line 15) | func WithRequestLogging(logger logger.Logger, next http.Handler) http.Ha... function logRequest (line 27) | func logRequest(logger logger.Logger, startedAt time.Time, wr *wrappedWr... FILE: pkg/middlewares/recovery.go function WithRecovery (line 11) | func WithRecovery(logger logger.Logger, next http.Handler) http.Handler { function safeHandler (line 27) | func safeHandler(next http.Handler, ri *recoveryInfo) http.Handler { type recoveryInfo (line 40) | type recoveryInfo struct FILE: pkg/middlewares/utils.go function requestInfo (line 9) | func requestInfo(req *http.Request) map[string]interface{} { function wrap (line 18) | func wrap(wr http.ResponseWriter, logger logger.Logger) *wrappedWriter { type wrappedWriter (line 26) | type wrappedWriter struct method WriteHeader (line 33) | func (wr *wrappedWriter) WriteHeader(statusCode int) { FILE: pkg/render/render.go constant contentTypeJSON (line 9) | contentTypeJSON = "application/json; charset=utf-8" function JSON (line 17) | func JSON(wr io.Writer, status int, val interface{}) error { FILE: usecases/posts/publish.go function NewPublication (line 13) | func NewPublication(lg logger.Logger, store Store, verifier userVerifier... type Publication (line 22) | type Publication struct method Publish (line 30) | func (pub *Publication) Publish(ctx context.Context, post domain.Post)... method Delete (line 52) | func (pub *Publication) Delete(ctx context.Context, name string) (*dom... FILE: usecases/posts/retrieval.go function NewRetriever (line 12) | func NewRetriever(lg logger.Logger, store Store) *Retriever { type Retriever (line 20) | type Retriever struct method Get (line 27) | func (ret *Retriever) Get(ctx context.Context, name string) (*domain.P... method Search (line 32) | func (ret *Retriever) Search(ctx context.Context, query Query) ([]doma... type Query (line 38) | type Query struct FILE: usecases/posts/store.go type Store (line 10) | type Store interface type userVerifier (line 18) | type userVerifier interface FILE: usecases/users/registration.go function NewRegistrar (line 12) | func NewRegistrar(lg logger.Logger, store Store) *Registrar { type Registrar (line 20) | type Registrar struct method Register (line 27) | func (reg *Registrar) Register(ctx context.Context, user domain.User) ... FILE: usecases/users/retrieval.go function NewRetriever (line 11) | func NewRetriever(lg logger.Logger, store Store) *Retriever { type Retriever (line 19) | type Retriever struct method Search (line 26) | func (ret *Retriever) Search(ctx context.Context, tags []string, limit... method Get (line 40) | func (ret *Retriever) Get(ctx context.Context, name string) (*domain.U... method VerifySecret (line 46) | func (ret *Retriever) VerifySecret(ctx context.Context, name, secret s... method findUser (line 55) | func (ret *Retriever) findUser(ctx context.Context, name string, strip... FILE: usecases/users/store.go type Store (line 11) | type Store interface