Documentation
¶
Index ¶
- Variables
- type HTTPHandler
- func (h *HTTPHandler) AddFilter(c echo.Context) error
- func (h *HTTPHandler) DeleteAssetByID(c echo.Context) error
- func (h *HTTPHandler) DeleteAssetByName(c echo.Context) error
- func (h *HTTPHandler) DeleteFilter(c echo.Context) error
- func (h *HTTPHandler) LoadAsset(c echo.Context) error
- func (h *HTTPHandler) LoadAssets(c echo.Context) error
- func (h *HTTPHandler) LoadFilter(c echo.Context) error
- func (h *HTTPHandler) SaveAsset(c echo.Context) error
- type Service
- func (s *Service) DeleteAssetByID(ctx context.Context, network string, ID string) (err error)
- func (s *Service) DeleteAssetByName(ctx context.Context, network string, name string) (err error)
- func (s *Service) LoadAsset(ctx context.Context, network string, ID string) (asset *registry.Asset, err error)
- func (s *Service) LoadAssets(ctx context.Context, network string, IDs ...string) (assets []*registry.Asset, err error)
- func (s *Service) SaveAsset(ctx context.Context, network string, asset *registry.Asset) error
- type SwearFilter
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type HTTPHandler ¶
type HTTPHandler struct {
// contains filtered or unexported fields
}
func NewHTTPHandler ¶
func NewHTTPHandler(service registry.Service, logger *zap.SugaredLogger) *HTTPHandler
func (*HTTPHandler) DeleteAssetByID ¶
func (h *HTTPHandler) DeleteAssetByID(c echo.Context) error
func (*HTTPHandler) DeleteAssetByName ¶
func (h *HTTPHandler) DeleteAssetByName(c echo.Context) error
func (*HTTPHandler) DeleteFilter ¶
func (h *HTTPHandler) DeleteFilter(c echo.Context) error
func (*HTTPHandler) LoadAssets ¶
func (h *HTTPHandler) LoadAssets(c echo.Context) error
func (*HTTPHandler) LoadFilter ¶
func (h *HTTPHandler) LoadFilter(c echo.Context) error
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) DeleteAssetByID ¶
func (*Service) DeleteAssetByName ¶
func (*Service) LoadAssets ¶
type SwearFilter ¶
type SwearFilter struct { //Options to tell the swear filter how to operate DisableNormalize bool //Disables normalization of alphabetic characters if set to true (ex: à -> a) DisableSpacedTab bool //Disables converting tabs to singular spaces (ex: [tab][tab] -> [space][space]) DisableMultiWhitespaceStripping bool //Disables stripping down multiple whitespaces (ex: hello[space][space]world -> hello[space]world) DisableZeroWidthStripping bool //Disables stripping zero-width spaces EnableSpacedBypass bool //Disables testing for spaced bypasses (if hell is in filter, look for occurrences of h and detect only alphabetic characters that follow; ex: h[space]e[space]l[space]l[space] -> hell) //A list of words to check against the filters BadWords map[string]struct{} // contains filtered or unexported fields }
SwearFilter contains settings for the swear filter
func NewSwearFilter ¶
func NewSwearFilter(enableSpacedBypass bool, uhohwords ...string) (filter *SwearFilter)
NewSwearFilter returns an initialized SwearFilter struct to check messages against
func (*SwearFilter) Add ¶
func (filter *SwearFilter) Add(badWords ...string)
Add appends the given word to the uhohwords list
func (*SwearFilter) Check ¶
func (filter *SwearFilter) Check(msg string) (trippedWords []string, err error)
Check will return any words that trip an enabled swear filter, an error if any, or nothing if you've removed all the words for some reason
func (*SwearFilter) Delete ¶
func (filter *SwearFilter) Delete(badWords ...string)
Delete deletes the given word from the uhohwords list
func (*SwearFilter) Load ¶
func (filter *SwearFilter) Load() (activeWords []string)
Load return the uhohwords list
Click to show internal directories.
Click to hide internal directories.