Documentation ¶
Index ¶
- Constants
- func Convert(content []byte, opts O2kOptions) (map[string]interface{}, error)
- func CreateKongService(baseName string, servers []*v3.Server, serviceDefaults []byte, ...) (map[string]interface{}, map[string]interface{}, error)
- func MustConvert(content []byte, opts O2kOptions) map[string]interface{}
- func Slugify(insoCompat bool, name ...string) string
- type O2kOptions
Constants ¶
View Source
const JSONSchemaVersion = "draft4"
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
func Convert(content []byte, opts O2kOptions) (map[string]interface{}, error)
Convert converts an OpenAPI spec to a Kong declarative file.
func CreateKongService ¶
func CreateKongService( baseName string, servers []*v3.Server, serviceDefaults []byte, upstreamDefaults []byte, tags []string, uuidNamespace uuid.UUID, skipID bool, ) (map[string]interface{}, map[string]interface{}, error)
CreateKongService creates a new Kong service entity, and optional upstream. `baseName` will be used as the name of the service (slugified), and as input for the UUIDv5 generation.
func MustConvert ¶
func MustConvert(content []byte, opts O2kOptions) map[string]interface{}
MustConvert is the same as Convert, but will panic if an error is returned.
Types ¶
type O2kOptions ¶
type O2kOptions struct { // Array of tags to mark all generated entities with, taken from 'x-kong-tags' if omitted. Tags []string // Base document name, will be taken from x-kong-name, or info.title (for UUID generation!) DocName string // Namespace for UUID generation, defaults to DNS namespace for UUID v5 UUIDNamespace uuid.UUID // Enable Inso compatibility mode InsoCompat bool // Skip ID generation (UUIDs) SkipID bool // Enable OIDC plugin generation OIDC bool // Ignore security errors (non-OIDC and AND/OR logic) IgnoreSecurityErrors bool }
O2KOptions defines the options for an O2K conversion operation
Click to show internal directories.
Click to hide internal directories.