Skip to content

Commit

Permalink
rena FSOpt for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Aug 22, 2021
1 parent 33c9193 commit 6d8b663
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions file_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type FS struct {
}

// NewFileServer creates file server with optional spa mode and optional direcroty listing (disabled by default)
func NewFileServer(public, local string, options ...FSOpt) (*FS, error) {
func NewFileServer(public, local string, options ...FsOpt) (*FS, error) {
res := FS{
public: public,
notFound: nil,
Expand Down Expand Up @@ -85,8 +85,8 @@ func (fs *FS) ServeHTTP(w http.ResponseWriter, r *http.Request) {
fs.handler(w, r)
}

// FSOpt defines functional option type
type FSOpt func(fs *FS) error
// FsOpt defines functional option type
type FsOpt func(fs *FS) error

// FsOptSPA turns on SPA mode returning "/index.html" on not-found
func FsOptSPA(fs *FS) error {
Expand All @@ -101,7 +101,7 @@ func FsOptListing(fs *FS) error {
}

// FsOptCustom404 sets custom 404 reader
func FsOptCustom404(fr io.Reader) FSOpt {
func FsOptCustom404(fr io.Reader) FsOpt {
return func(fs *FS) error {
fs.notFound = fr
return nil
Expand Down

0 comments on commit 6d8b663

Please sign in to comment.