Files
opencloud/vendor/github.com/gookit/goutil/comdef/interface.go
dependabot[bot] 0df009eae0 Bump github.com/gookit/config/v2 from 2.2.3 to 2.2.4
Bumps [github.com/gookit/config/v2](https://github.com/gookit/config) from 2.2.3 to 2.2.4.
- [Release notes](https://github.com/gookit/config/releases)
- [Commits](https://github.com/gookit/config/compare/v2.2.3...v2.2.4)

---
updated-dependencies:
- dependency-name: github.com/gookit/config/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-03 10:26:28 +01:00

71 lines
1.2 KiB
Go

package comdef
import (
"fmt"
"io"
)
// ByteStringWriter interface
type ByteStringWriter interface {
io.Writer
io.ByteWriter
io.StringWriter
fmt.Stringer
}
// StringWriteStringer interface
type StringWriteStringer interface {
io.StringWriter
fmt.Stringer
}
// Int64able interface
type Int64able interface {
Int64() (int64, error)
}
//
//
// Matcher type
//
//
// Matcher interface
type Matcher[T any] interface {
Match(s T) bool
}
// MatchFunc definition. implements Matcher interface
type MatchFunc[T any] func(v T) bool
// Match satisfies the Matcher interface
func (fn MatchFunc[T]) Match(v T) bool {
return fn(v)
}
// StringMatcher interface
type StringMatcher interface {
Match(s string) bool
}
// StringMatchFunc definition
type StringMatchFunc func(s string) bool
// Match satisfies the StringMatcher interface
func (fn StringMatchFunc) Match(s string) bool {
return fn(s)
}
// StringHandler interface
type StringHandler interface {
Handle(s string) string
}
// StringHandleFunc definition
type StringHandleFunc func(s string) string
// Handle satisfies the StringHandler interface
func (fn StringHandleFunc) Handle(s string) string {
return fn(s)
}