Documentation ¶
Index ¶
- Constants
- func Contains[T comparable](slice []T, value T) bool
- func ToSnakeCase(str string) string
- type AttributeInfo
- type AttributeScope
- type ChipiCallbackInterface
- type ChipiCallbacks
- func (c *ChipiCallbacks) EnumResolver(t reflect.Type) (bool, Enum)
- func (c *ChipiCallbacks) ExtraComponentsAndPaths() (openapi3.Schemas, openapi3.Paths)
- func (c *ChipiCallbacks) FilterField(ctx context.Context, fieldInfo AttributeInfo) (bool, error)
- func (c *ChipiCallbacks) FilterRoute(ctx context.Context, method string, pattern string) (bool, error)
- func (c *ChipiCallbacks) SchemaResolver(fieldInfo AttributeInfo, castName string) (*openapi3.Schema, bool)
- type Enum
- type EnumEntry
- type EnumResolverInterface
- type ExtraComponentsAndPathsInterface
- type FilterFieldInterface
- type FilterRouteInterface
- type SchemaResolverInterface
Constants ¶
View Source
const (
ScopeNone = iota
)
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](slice []T, value T) bool
func ToSnakeCase ¶
convert variable name to snake_case style work for camelCase and PascalCase as input
Types ¶
type AttributeInfo ¶
type AttributeInfo struct { Scope AttributeScope // contains filtered or unexported fields }
func (AttributeInfo) AppendPath ¶
func (ai AttributeInfo) AppendPath(segment string) AttributeInfo
func (AttributeInfo) Empty ¶
func (ai AttributeInfo) Empty() bool
func (AttributeInfo) ModelPath ¶
func (ai AttributeInfo) ModelPath() string
func (AttributeInfo) QueryPath ¶
func (ai AttributeInfo) QueryPath() string
func (AttributeInfo) String ¶
func (ai AttributeInfo) String() string
func (AttributeInfo) WithModelPath ¶
func (ai AttributeInfo) WithModelPath(path string) AttributeInfo
type ChipiCallbackInterface ¶
type ChipiCallbackInterface interface { }
This object can implement FilterRoute/FilterField/EnumResolver/SchemaResolver
type ChipiCallbacks ¶
type ChipiCallbacks struct { FilterRouteInterface FilterFieldInterface EnumResolverInterface SchemaResolverInterface // contains filtered or unexported fields }
func NewChipiCallbacks ¶
func NewChipiCallbacks(i ChipiCallbackInterface) ChipiCallbacks
func (*ChipiCallbacks) EnumResolver ¶
func (c *ChipiCallbacks) EnumResolver(t reflect.Type) (bool, Enum)
func (*ChipiCallbacks) ExtraComponentsAndPaths ¶
func (c *ChipiCallbacks) ExtraComponentsAndPaths() (openapi3.Schemas, openapi3.Paths)
func (*ChipiCallbacks) FilterField ¶
func (c *ChipiCallbacks) FilterField(ctx context.Context, fieldInfo AttributeInfo) (bool, error)
func (*ChipiCallbacks) FilterRoute ¶
func (*ChipiCallbacks) SchemaResolver ¶
func (c *ChipiCallbacks) SchemaResolver(fieldInfo AttributeInfo, castName string) (*openapi3.Schema, bool)
type EnumResolverInterface ¶
type FilterFieldInterface ¶
type FilterFieldInterface interface {
FilterField(ctx context.Context, fieldInfo AttributeInfo) (bool, error)
}
type FilterRouteInterface ¶
type SchemaResolverInterface ¶
type SchemaResolverInterface interface { // CastName is the string after the `as:` in the field tag // e.g. `chipi:"as:uuid"` => CastName = "uuid" // The openapi3.Schema is the schema that will be used to define the CastName field // The boolean decide if we create a $ref in the openapi file SchemaResolver(fieldInfo AttributeInfo, castName string) (*openapi3.Schema, bool) }
Click to show internal directories.
Click to hide internal directories.