-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53ae0a0
commit 62c6e98
Showing
6 changed files
with
80 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package service | ||
|
||
// Name of the implemented services. | ||
const ( | ||
Static = "static" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package static | ||
|
||
import ( | ||
"github.com/go-goyave/websocket-example/service" | ||
"goyave.dev/goyave/v5/util/fsutil" | ||
) | ||
|
||
// Service for the static resources. | ||
type Service struct { | ||
fs fsutil.Embed | ||
} | ||
|
||
// NewService create a new user Service. | ||
func NewService(fs fsutil.Embed) *Service { | ||
return &Service{ | ||
fs: fs, | ||
} | ||
} | ||
|
||
// FS returns the static resources filesystem | ||
func (s Service) FS() fsutil.Embed { | ||
return s.fs | ||
} | ||
|
||
// Name returns the service name. | ||
func (s *Service) Name() string { | ||
return service.Static | ||
} |