anysdk

package
v0.0.1-alpha25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodDescription string = "description"
	MethodName        string = "MethodName"
	RequiredParams    string = "RequiredParams"
	SQLVerb           string = "SQLVerb"
)
View Source
const (
	ExtensionKeyAlwaysRequired string = "x-alwaysRequired"
	ExtensionKeyGraphQL        string = "x-stackQL-graphQL"
	ExtensionKeyConfig         string = "x-stackQL-config"
	ExtensionKeyProvider       string = "x-stackql-provider"
	ExtensionKeyResources      string = "x-stackQL-resources"
	ExtensionKeyStringOnly     string = "x-stackQL-stringOnly"
)
View Source
const (
	RequestBodyKeyPrefix    string = "data"
	RequestBodyKeyDelimiter string = "__"
	RequestBodyBaseKey      string = RequestBodyKeyPrefix + RequestBodyKeyDelimiter
)
View Source
const (
	ConfigFilesMode fs.FileMode = 0664
)
View Source
const (
	ParamEncodeDelimiter string = "%"
)
View Source
const (
	ViewKeyResourceLevelSelect string = "select"
)

Variables

View Source
var (
	IgnoreEmbedded  bool
	OpenapiFileRoot string
)
View Source
var (
	AnonymousColumnName string = defaultAnonymousColumnName
)

Functions

func DefaultLinkHeaderTransformer

func DefaultLinkHeaderTransformer(input interface{}) (interface{}, error)

func DefaultRequestBodyAttributeRename

func DefaultRequestBodyAttributeRename(k string) string

func GetDescribeHeader

func GetDescribeHeader(extended bool) []string

func GetProviderDocBytes

func GetProviderDocBytes(prov string) ([]byte, error)

func GetResourcesHeader

func GetResourcesHeader(extended bool) []string

func GetResourcesRegisterDocBytes

func GetResourcesRegisterDocBytes(url string) ([]byte, error)

func GetServiceDocBytes

func GetServiceDocBytes(url string) ([]byte, error)

func GetServicesHeader

func GetServicesHeader(extended bool) []string

func GetTestingView

func GetTestingView() standardView

func InterfaceToSQLType

func InterfaceToSQLType(val interface{}) (sqltypes.Value, error)

func ObtainServerURLsFromServers

func ObtainServerURLsFromServers(svs []*openapi3.Server, vars map[string]string) ([]string, error)

func ProviderTypeConditionIsValid

func ProviderTypeConditionIsValid(providerType string, lhs string, rhs interface{}) bool

func ResourceConditionIsValid

func ResourceConditionIsValid(lhs string, rhs interface{}) bool

func ResourceKeyExists

func ResourceKeyExists(key string) bool

func ServiceConditionIsValid

func ServiceConditionIsValid(lhs string, rhs interface{}) bool

func ServiceKeyExists

func ServiceKeyExists(key string) bool

Types

type Addressable

type Addressable interface {
	ConditionIsValid(lhs string, rhs interface{}) bool
	GetLocation() string
	GetName() string
	GetSchema() (Schema, bool)
	GetType() string
	IsRequired() bool
}

func NewOptionalAddressableRequestBodyProperty

func NewOptionalAddressableRequestBodyProperty(name string, s Schema) Addressable

func NewParameter

func NewParameter(param *openapi3.Parameter, svc Service) Addressable

func NewRequiredAddressableRequestBodyProperty

func NewRequiredAddressableRequestBodyProperty(name string, s Schema) Addressable

type AuthDTO

type AuthDTO interface {
	JSONLookup(token string) (interface{}, error)
	GetInlineBasicCredentials() string
	GetType() string
	GetKeyID() string
	GetKeyIDEnvVar() string
	GetKeyFilePath() string
	GetKeyFilePathEnvVar() string
	GetKeyEnvVar() string
	GetScopes() []string
	GetValuePrefix() string
	GetEnvVarUsername() string
	GetEnvVarPassword() string
	GetEnvVarAPIKeyStr() string
	GetEnvVarAPISecretStr() string
	GetSuccessor() (AuthDTO, bool)
	GetLocation() string
	GetName() string
}

type AuthMetadata

type AuthMetadata struct {
	Principal string `json:"principal"`
	Type      string `json:"type"`
	Source    string `json:"source"`
}

func (*AuthMetadata) GetHeaders

func (am *AuthMetadata) GetHeaders() []string

func (*AuthMetadata) ToMap

func (am *AuthMetadata) ToMap() map[string]interface{}

type BodyMap

type BodyMap map[string]interface{}

type BodyParamPair

type BodyParamPair interface {
	GetKey() string
	GetVal() interface{}
}

type ColumnDescriptor

type ColumnDescriptor interface {
	GetAlias() string
	GetDecoratedCol() string
	GetIdentifier() string
	GetName() string
	GetNode() sqlparser.SQLNode
	GetQualifier() string
	GetRepresentativeSchema() Schema
	GetSchema() Schema
	GetVal() *sqlparser.SQLVal
	// contains filtered or unexported methods
}

func NewColumnDescriptor

func NewColumnDescriptor(alias string, name string, qualifier string, decoratedCol string, node sqlparser.SQLNode, schema Schema, val *sqlparser.SQLVal) ColumnDescriptor

type DiscoveryDoc

type DiscoveryDoc interface {
	// contains filtered or unexported methods
}

type EncodableString

type EncodableString string

type ExecContext

type ExecContext interface {
	GetExecPayload() internaldto.ExecPayload
	GetResource() Resource
}

func NewExecContext

func NewExecContext(payload internaldto.ExecPayload, rsc Resource) ExecContext

type ExpectedRequest

type ExpectedRequest interface {
	GetBodyMediaType() string
	GetSchema() Schema
	GetRequired() []string
	// contains filtered or unexported methods
}

type ExpectedResponse

type ExpectedResponse interface {
	GetBodyMediaType() string
	GetOpenAPIDocKey() string
	GetObjectKey() string
	GetSchema() Schema
	// contains filtered or unexported methods
}

type GraphQL

type GraphQL interface {
	JSONLookup(token string) (interface{}, error)
	GetCursorJSONPath() (string, bool)
	GetResponseJSONPath() (string, bool)
	GetID() string
	GetQuery() string
	GetURL() string
	GetHTTPVerb() string
	GetCursor() GraphQLElement
	GetResponseSelection() GraphQLElement
}

type GraphQLElement

type GraphQLElement map[string]interface{}

type HTTPArmoury

type HTTPArmoury interface {
	AddRequestParams(HTTPArmouryParameters)
	GetRequestParams() []HTTPArmouryParameters
	GetRequestSchema() Schema
	GetResponseSchema() Schema
	SetRequestParams([]HTTPArmouryParameters)
	SetRequestSchema(Schema)
	SetResponseSchema(Schema)
}

func NewHTTPArmoury

func NewHTTPArmoury() HTTPArmoury

type HTTPArmouryParameters

type HTTPArmouryParameters interface {
	Encode() string
	GetBodyBytes() []byte
	GetHeader() http.Header
	GetParameters() HttpParameters
	GetQuery() url.Values
	GetRequest() *http.Request
	SetBodyBytes(b []byte)
	SetHeaderKV(k string, v []string)
	SetNextPage(ops OperationStore, token string, tokenKey internaldto.HTTPElement) (*http.Request, error)
	SetParameters(HttpParameters)
	SetRawQuery(string)
	SetRequest(*http.Request)
	SetRequestBodyMap(BodyMap)
	ToFlatMap() (map[string]interface{}, error)
}

func NewHTTPArmouryParameters

func NewHTTPArmouryParameters() HTTPArmouryParameters

type HTTPPreparator

type HTTPPreparator interface {
	BuildHTTPRequestCtx() (HTTPArmoury, error)
	BuildHTTPRequestCtxFromAnnotation() (HTTPArmoury, error)
}

func NewHTTPPreparator

func NewHTTPPreparator(
	prov Provider,
	svc Service,
	m OperationStore,
	paramMap map[int]map[string]interface{},
	parameters streaming.MapStream,
	execContext ExecContext,
	logger *logrus.Logger,
) HTTPPreparator

type HttpParameters

type HttpParameters interface {
	Encode() string
	IngestMap(map[string]interface{}) error
	StoreParameter(Addressable, interface{})
	ToFlatMap() (map[string]interface{}, error)
	GetParameter(paramName, paramIn string) (ParameterBinding, bool)
	GetRemainingQueryParamsFlatMap(keysRemaining map[string]interface{}) (map[string]interface{}, error)
	GetServerParameterFlatMap() (map[string]interface{}, error)
	SetResponseBodyParam(key string, val interface{})
	SetServerParam(key string, svc Service, val interface{})
	SetRequestBodyParam(key string, val interface{})
	SetRequestBody(map[string]interface{})
	GetRequestBody() map[string]interface{}
}

func NewHttpParameters

func NewHttpParameters(method OperationStore) HttpParameters

type ITable

type ITable interface {
	GetName() string
	KeyExists(string) bool
	GetKey(string) (interface{}, error)
	GetKeyAsSqlVal(string) (sqltypes.Value, error)
	GetRequiredParameters() map[string]Addressable
	FilterBy(func(interface{}) (ITable, error)) (ITable, error)
}

type Loader

type Loader interface {
	LoadFromBytes(bytes []byte) (Service, error)
	LoadFromBytesAndResources(rr ResourceRegister, resourceKey string, bytes []byte) (Service, error)
	// contains filtered or unexported methods
}

func NewLoader

func NewLoader() Loader

type MetadataStore

type MetadataStore struct {
	Store map[string]Service
}

func (*MetadataStore) GetResource

func (ms *MetadataStore) GetResource(serviceName string, resourceName string) (Resource, error)

func (*MetadataStore) GetResources

func (ms *MetadataStore) GetResources(serviceName string) (map[string]Resource, error)

func (*MetadataStore) GetServices

func (ms *MetadataStore) GetServices() ([]Service, error)

type MethodSet

type MethodSet []OperationStore

func (MethodSet) GetFirst

func (ms MethodSet) GetFirst() (OperationStore, string, bool)

func (MethodSet) GetFirstMatch

func (ms MethodSet) GetFirstMatch(params map[string]interface{}) (OperationStore, map[string]interface{}, bool)

type Methods

type Methods map[string]standardOperationStore

func (Methods) FindFromSelector

func (ms Methods) FindFromSelector(sel OperationSelector) (OperationStore, error)

func (Methods) FindMethod

func (ms Methods) FindMethod(key string) (OperationStore, error)

func (Methods) OrderMethods

func (ms Methods) OrderMethods() ([]OperationStore, error)

type OperationInverse

type OperationInverse interface {
	JSONLookup(token string) (interface{}, error)
	GetOperationStore() (OperationStore, bool)
	GetTokens() (OperationTokens, bool)
	GetParamMap(response.Response) (map[string]interface{}, error)
}

type OperationRef

type OperationRef struct {
	Ref   string `json:"$ref" yaml:"$ref"`
	Value *openapi3.Operation
}

func (OperationRef) ExtractMethodItem

func (opr OperationRef) ExtractMethodItem() string

func (OperationRef) ExtractPathItem

func (opr OperationRef) ExtractPathItem() string

func (OperationRef) ExtractServiceDocPath

func (opr OperationRef) ExtractServiceDocPath() string

func (OperationRef) JSONLookup

func (value OperationRef) JSONLookup(token string) (interface{}, error)

func (*OperationRef) MarshalJSON

func (value *OperationRef) MarshalJSON() ([]byte, error)

func (*OperationRef) UnmarshalJSON

func (value *OperationRef) UnmarshalJSON(data []byte) error

func (*OperationRef) Validate

func (value *OperationRef) Validate(ctx context.Context) error

type OperationSelector

type OperationSelector interface {
	GetSQLVerb() string
	GetParameters() map[string]interface{}
}

func NewOperationSelector

func NewOperationSelector(slqVerb string, params map[string]interface{}) OperationSelector

type OperationStore

type OperationStore interface {
	ITable
	GetMethodKey() string
	GetSQLVerb() string
	GetGraphQL() GraphQL
	GetInverse() (OperationInverse, bool)
	GetStackQLConfig() StackQLConfig
	GetParameters() map[string]Addressable
	GetPathItem() *openapi3.PathItem
	GetAPIMethod() string
	GetOperationRef() *OperationRef
	GetPathRef() *PathItemRef
	GetRequest() (ExpectedRequest, bool)
	GetResponse() (ExpectedResponse, bool)
	GetServers() *openapi3.Servers
	GetParameterizedPath() string
	GetProviderService() ProviderService
	GetProvider() Provider
	GetService() Service
	GetResource() Resource
	ParameterMatch(params map[string]interface{}) (map[string]interface{}, bool)
	GetOperationParameter(key string) (Addressable, bool)
	GetQueryTransposeAlgorithm() string
	GetSelectSchemaAndObjectPath() (Schema, string, error)
	ProcessResponse(*http.Response) (ProcessedOperationResponse, error)
	Parameterize(prov Provider, parentDoc Service, inputParams HttpParameters, requestBody interface{}) (*openapi3filter.RequestValidationInput, error)
	GetSelectItemsKey() string
	GetResponseBodySchemaAndMediaType() (Schema, string, error)
	GetRequiredParameters() map[string]Addressable
	GetOptionalParameters() map[string]Addressable
	GetParameter(paramKey string) (Addressable, bool)
	GetUnionRequiredParameters() (map[string]Addressable, error)
	GetPaginationResponseTokenSemantic() (TokenSemantic, bool)
	MarshalBody(body interface{}, expectedRequest ExpectedRequest) ([]byte, error)
	GetRequestBodySchema() (Schema, error)
	GetNonBodyParameters() map[string]Addressable
	IsAwaitable() bool
	DeprecatedProcessResponse(response *http.Response) (map[string]interface{}, error)
	GetRequestTranslateAlgorithm() string
	IsRequiredRequestBodyProperty(key string) bool
	GetPaginationRequestTokenSemantic() (TokenSemantic, bool)
	IsNullary() bool
	ToPresentationMap(extended bool) map[string]interface{}
	GetColumnOrder(extended bool) []string
	// contains filtered or unexported methods
}

func NewEmptyOperationStore

func NewEmptyOperationStore() OperationStore

type OperationStoreRef

type OperationStoreRef struct {
	Ref   string `json:"$ref" yaml:"$ref"`
	Value *standardOperationStore
}

func (OperationStoreRef) JSONLookup

func (value OperationStoreRef) JSONLookup(token string) (interface{}, error)

func (*OperationStoreRef) MarshalJSON

func (value *OperationStoreRef) MarshalJSON() ([]byte, error)

func (*OperationStoreRef) UnmarshalJSON

func (value *OperationStoreRef) UnmarshalJSON(data []byte) error

type OperationTokens

type OperationTokens interface {
	JSONLookup(token string) (interface{}, error)
	GetTokenSemantic(key string) (TokenSemantic, bool)
}

type Pagination

type Pagination interface {
	JSONLookup(token string) (interface{}, error)
	GetRequestToken() TokenSemantic
	GetResponseToken() TokenSemantic
}

type ParamInputStrem

type ParamInputStrem interface {
	Read() ([]HttpParameters, error)
}

func NewStandardParamInputStrem

func NewStandardParamInputStrem() ParamInputStrem

type ParamMap

type ParamMap map[string]ParameterBinding

type ParamPair

type ParamPair interface {
	GetKey() string
	GetParamBinding() ParameterBinding
}

type ParameterBinding

type ParameterBinding interface {
	GetParam() Addressable
	GetVal() interface{}
}

func NewParameterBinding

func NewParameterBinding(param Addressable, val interface{}) ParameterBinding

type ParameterSuffixMap

type ParameterSuffixMap struct {
	// contains filtered or unexported fields
}

func MakeSuffixMapFromParameterMap

func MakeSuffixMapFromParameterMap(m map[string]Addressable) *ParameterSuffixMap

func NewParameterSuffixMap

func NewParameterSuffixMap() *ParameterSuffixMap

func (*ParameterSuffixMap) Delete

func (psm *ParameterSuffixMap) Delete(k string) bool

func (*ParameterSuffixMap) Get

func (psm *ParameterSuffixMap) Get(k string) (Addressable, bool)

func (*ParameterSuffixMap) GetAll

func (psm *ParameterSuffixMap) GetAll() map[string]Addressable

func (*ParameterSuffixMap) Put

func (psm *ParameterSuffixMap) Put(k string, v Addressable)

func (*ParameterSuffixMap) Size

func (psm *ParameterSuffixMap) Size() int

type Params

type Params interface {
	GetParameter(key string) (Addressable, bool)
}

func NewParameters

func NewParameters(params openapi3.Parameters, svc Service) Params

type PathItemRef

type PathItemRef struct {
	Ref   string `json:"$ref" yaml:"$ref"`
	Value *openapi3.PathItem
}

type ProcessedOperationResponse

type ProcessedOperationResponse interface {
	GetResponse() (response.Response, bool)
	GetReversal() (HTTPPreparator, bool)
	GetReversalError() (error, bool)
	// contains filtered or unexported methods
}

type Provider

type Provider interface {
	Debug() string
	GetAuth() (AuthDTO, bool)
	GetDeleteItemsKey() string
	GetName() string
	GetProviderServices() map[string]ProviderService
	GetPaginationRequestTokenSemantic() (TokenSemantic, bool)
	GetPaginationResponseTokenSemantic() (TokenSemantic, bool)
	GetProviderService(key string) (ProviderService, error)
	GetQueryTransposeAlgorithm() string
	GetRequestTranslateAlgorithm() string
	GetResourcesShallow(serviceKey string) (ResourceRegister, error)
	GetStackQLConfig() (StackQLConfig, bool)
	JSONLookup(token string) (interface{}, error)
	MarshalJSON() ([]byte, error)
	UnmarshalJSON(data []byte) error
	// contains filtered or unexported methods
}

func LoadProviderByName

func LoadProviderByName(prov, version string) (Provider, error)

func LoadProviderDocFromBytes

func LoadProviderDocFromBytes(bytes []byte) (Provider, error)

func LoadProviderDocFromFile

func LoadProviderDocFromFile(fileName string) (Provider, error)

func NewProvider

func NewProvider(id, name, title, version string) Provider

type ProviderDescription

type ProviderDescription struct {
	Versions []string `json:"versions" yaml: "versions"`
	// contains filtered or unexported fields
}

func (ProviderDescription) GetLatestVersion

func (pd ProviderDescription) GetLatestVersion() (string, error)

type ProviderInfo

type ProviderInfo struct {
	Name    string
	Version string
}

type ProviderService

type ProviderService interface {
	ITable
	GetQueryTransposeAlgorithm() string
	GetProvider() (Provider, bool)
	GetService() (Service, error)
	GetRequestTranslateAlgorithm() string
	GetResourcesShallow() (ResourceRegister, error)
	GetPaginationRequestTokenSemantic() (TokenSemantic, bool)
	GetPaginationResponseTokenSemantic() (TokenSemantic, bool)
	ConditionIsValid(lhs string, rhs interface{}) bool
	GetID() string
	GetServiceFragment(resourceKey string) (Service, error)
	GetResourcesRefRef() string
	PeekServiceFragment(resourceKey string) (Service, bool)
	SetServiceRefVal(Service) bool
	IsPreferred() bool
	GetTitle() string
	GetVersion() string
	GetDescription() string
	// contains filtered or unexported methods
}

func NewEmptyProviderService

func NewEmptyProviderService() ProviderService

type ProvidersList

type ProvidersList struct {
	Providers map[string]ProviderDescription `json:"providers" yaml: "providers"`
	// contains filtered or unexported fields
}

func NewProvidersList

func NewProvidersList() ProvidersList

func (ProvidersList) GetLatestList

func (pl ProvidersList) GetLatestList() (ProvidersList, error)

func (ProvidersList) GetSingleProviderList

func (pl ProvidersList) GetSingleProviderList(prov string) ProvidersList

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func (*Registry) GetDocBytes

func (r *Registry) GetDocBytes(docPath string) ([]byte, error)

func (*Registry) GetLatestAvailableVersion

func (r *Registry) GetLatestAvailableVersion(providerName string) (string, error)

func (*Registry) GetLatestPublishedVersion

func (r *Registry) GetLatestPublishedVersion(providerName string) (string, error)

func (*Registry) GetResourcesRegisterDocBytes

func (r *Registry) GetResourcesRegisterDocBytes(url string) ([]byte, error)

func (*Registry) GetResourcesShallowFromProvider

func (r *Registry) GetResourcesShallowFromProvider(pr Provider, serviceKey string) (ResourceRegister, error)

func (*Registry) GetResourcesShallowFromProviderService

func (r *Registry) GetResourcesShallowFromProviderService(pr ProviderService) (ResourceRegister, error)

func (*Registry) GetResourcesShallowFromURL

func (r *Registry) GetResourcesShallowFromURL(ps ProviderService) (ResourceRegister, error)

func (*Registry) GetService

func (r *Registry) GetService(ps ProviderService) (Service, error)

func (*Registry) GetServiceDocBytes

func (r *Registry) GetServiceDocBytes(url string) ([]byte, error)

func (*Registry) GetServiceFragment

func (r *Registry) GetServiceFragment(ps ProviderService, resourceKey string) (Service, error)

func (*Registry) GetServiceFromProviderService

func (r *Registry) GetServiceFromProviderService(ps ProviderService) (Service, error)

func (*Registry) ListAllAvailableProviders

func (r *Registry) ListAllAvailableProviders() (map[string]ProviderDescription, error)

func (*Registry) ListAllProviderVersions

func (r *Registry) ListAllProviderVersions(prov string) (map[string]ProviderDescription, error)

func (*Registry) ListLocallyAvailableProviders

func (r *Registry) ListLocallyAvailableProviders() map[string]ProviderDescription

func (*Registry) LoadProviderByName

func (r *Registry) LoadProviderByName(prov string, version string) (Provider, error)

func (*Registry) PullAndPersistProviderArchive

func (r *Registry) PullAndPersistProviderArchive(prov string, version string) error

func (*Registry) PullProviderArchive

func (r *Registry) PullProviderArchive(prov string, version string) (io.ReadCloser, error)

type RegistryAPI

type RegistryAPI interface {
	PullAndPersistProviderArchive(string, string) error
	PullProviderArchive(string, string) (io.ReadCloser, error)
	ListAllAvailableProviders() (map[string]ProviderDescription, error)
	ListAllProviderVersions(string) (map[string]ProviderDescription, error)
	ListLocallyAvailableProviders() map[string]ProviderDescription
	GetDocBytes(string) ([]byte, error)
	GetLatestAvailableVersion(string) (string, error)
	GetLatestPublishedVersion(string) (string, error)
	GetResourcesShallowFromProvider(Provider, string) (ResourceRegister, error)
	GetResourcesShallowFromProviderService(ProviderService) (ResourceRegister, error)
	GetResourcesShallowFromURL(ps ProviderService) (ResourceRegister, error)
	GetService(ps ProviderService) (Service, error)
	GetServiceFragment(ProviderService, string) (Service, error)
	GetServiceFromProviderService(ProviderService) (Service, error)
	GetServiceDocBytes(string) ([]byte, error)
	GetResourcesRegisterDocBytes(string) ([]byte, error)
	LoadProviderByName(string, string) (Provider, error)
}

func GetMockLocalRegistry

func GetMockLocalRegistry(vc RegistryConfig) (RegistryAPI, error)

func GetMockRegistry

func GetMockRegistry(vc RegistryConfig) (RegistryAPI, error)

func NewRegistry

func NewRegistry(registryCfg RegistryConfig, transport http.RoundTripper) (RegistryAPI, error)

type RegistryConfig

type RegistryConfig struct {
	RegistryURL      string                   `json:"url" yaml:"url"`
	SrcPrefix        *string                  `json:"srcPrefix" yaml:"srcPrefix"`
	DistPrefix       *string                  `json:"distPrefix" yaml:"distPrefix"`
	AllowSrcDownload bool                     `json:"allowSrcDownload" yaml:"allowSrcDownload"`
	LocalDocRoot     string                   `json:"localDocRoot" yaml:"localDocRoot"`
	VerfifyConfig    *edcrypto.VerifierConfig `json:"verifyConfig" yaml:"verifyConfig"`
}

type Resource

type Resource interface {
	ITable
	GetQueryTransposeAlgorithm() string
	GetID() string
	GetTitle() string
	GetDescription() string
	GetSelectorAlgorithm() string
	GetMethods() Methods
	GetServiceDocPath() *ServiceRef
	GetRequestTranslateAlgorithm() string
	GetPaginationRequestTokenSemantic() (TokenSemantic, bool)
	GetPaginationResponseTokenSemantic() (TokenSemantic, bool)
	FindMethod(key string) (OperationStore, error)
	GetFirstMethodFromSQLVerb(sqlVerb string) (OperationStore, string, bool)
	GetFirstMethodMatchFromSQLVerb(sqlVerb string, parameters map[string]interface{}) (OperationStore, map[string]interface{}, bool)
	GetService() (Service, bool)
	GetViewBodyDDLForSQLDialect(sqlDialect string) (string, bool)
	GetMethodsMatched() Methods
	ToMap(extended bool) map[string]interface{}
	// contains filtered or unexported methods
}

func NewEmptyResource

func NewEmptyResource() Resource

type ResourceRegister

type ResourceRegister interface {
	//
	GetServiceDocPath() *ServiceRef
	ObtainServiceDocUrl(resourceKey string) string
	SetProviderService(ps ProviderService)
	SetProvider(p Provider)
	GetResources() map[string]Resource
	GetResource(string) (Resource, bool)
	// contains filtered or unexported methods
}

func LoadResourcesShallow

func LoadResourcesShallow(ps ProviderService, bt []byte) (ResourceRegister, error)

func NewResourceRegister

func NewResourceRegister() ResourceRegister

type ResourcesRef

type ResourcesRef struct {
	Ref   string `json:"$ref" yaml:"$ref"`
	Value *standardResourceRegister
}

type ResponseKeys

type ResponseKeys struct {
	SelectItemsKey string `json:"selectItemsKey,omitempty" yaml:"selectItemsKey,omitempty"`
	DeleteItemsKey string `json:"deleteItemsKey,omitempty" yaml:"deleteItemsKey,omitempty"`
}

type SQLExternalColumn

type SQLExternalColumn interface {
	GetName() string
	GetType() string
	GetOid() uint32
	GetWidth() int
	GetPrecision() int
}

type SQLExternalConnection

type SQLExternalConnection interface {
	GetConnectionName() string
	GetTables() map[string]SQLExternalTable
}

type SQLExternalTable

type SQLExternalTable interface {
	GetCatalogName() string
	GetSchemaName() string
	GetName() string
	GetColumns() []SQLExternalColumn
}

type Schema

type Schema interface {
	SetDefaultColName(string)

	ConditionIsValid(lhs string, rhs interface{}) bool
	DeprecatedProcessHttpResponse(response *http.Response, path string) (map[string]interface{}, error)
	FindByPath(path string, visited map[string]bool) Schema
	GetAdditionalProperties() (Schema, bool)
	GetAllColumns(string) []string
	GetItemProperty(k string) (Schema, bool)
	GetItems() (Schema, error)
	GetItemsSchema() (Schema, error)
	GetName() string
	GetPath() string
	GetProperties() (Schemas, error)
	GetProperty(propertyKey string) (Schema, bool)
	GetSelectionName() string
	GetSelectListItems(key string) (Schema, string)
	GetTitle() string
	GetType() string
	GetPropertySchema(key string) (Schema, error)
	GetRequired() []string
	GetSelectSchema(itemsKey, mediaType string) (Schema, string, error)
	IsArrayRef() bool
	IsBoolean() bool
	IsFloat() bool
	IsIntegral() bool
	IsReadOnly() bool
	IsRequired(key string) bool
	ProcessHttpResponseTesting(r *http.Response, path string, defaultMediaType string) (response.Response, error)
	SetProperties(openapi3.Schemas)
	SetType(string)
	SetKey(string)
	Tabulate(bool, string) Tabulation
	ToDescriptionMap(extended bool) map[string]interface{}
	// contains filtered or unexported methods
}

func NewSchema

func NewSchema(sc *openapi3.Schema, svc Service, key string, path string) Schema

type Schemas

type Schemas map[string]Schema

type Service

type Service interface {
	GetT() *openapi3.T
	GetQueryTransposeAlgorithm() string
	IsPreferred() bool
	GetRequestTranslateAlgorithm() string
	GetPaginationRequestTokenSemantic() (TokenSemantic, bool)
	GetPaginationResponseTokenSemantic() (TokenSemantic, bool)
	GetServers() []*openapi3.Server
	GetResources() (map[string]Resource, error)
	GetComponents() openapi3.Components
	GetName() string
	GetResource(resourceName string) (Resource, error)
	GetSchema(key string) (Schema, error)
	GetContactURL() string
	// contains filtered or unexported methods
}

func LoadServiceDocFromBytes

func LoadServiceDocFromBytes(ps ProviderService, bytes []byte) (Service, error)

func LoadServiceDocFromFile

func LoadServiceDocFromFile(ps ProviderService, fileName string) (Service, error)

func LoadServiceSubsetDocFromBytes

func LoadServiceSubsetDocFromBytes(rr ResourceRegister, resourceKey string, bytes []byte) (Service, error)

func NewService

func NewService(t *openapi3.T) Service

type ServiceRef

type ServiceRef struct {
	Ref   string `json:"$ref" yaml:"$ref"`
	Value *standardService
}

type SimpleMockRegistryRoundTripper

type SimpleMockRegistryRoundTripper struct {
	// contains filtered or unexported fields
}

func NewSimpleMockRegistryRoundTripper

func NewSimpleMockRegistryRoundTripper(fileRoot string, registryRoot *url.URL) *SimpleMockRegistryRoundTripper

func (*SimpleMockRegistryRoundTripper) RoundTrip

type StackQLConfig

type StackQLConfig interface {
	GetAuth() (AuthDTO, bool)
	GetViewBodyDDLForSQLDialect(sqlDialect string, viewName string) (string, bool)
	GetQueryTranspose() (Transform, bool)
	GetRequestTranslate() (Transform, bool)
	GetPagination() (Pagination, bool)
	GetVariations() (Variations, bool)
	GetViews() map[string]View
	GetExternalTables() map[string]SQLExternalTable
	// contains filtered or unexported methods
}

type StandardTransformerLocator

type StandardTransformerLocator struct{}

func (*StandardTransformerLocator) GetTransformer

func (stl *StandardTransformerLocator) GetTransformer(tokenSemantic TokenSemantic) (TokenTransformer, error)

type Tabulation

type Tabulation interface {
	GetColumns() []ColumnDescriptor
	GetSchema() Schema
	PushBackColumn(col ColumnDescriptor)
	GetName() string
	RenameColumnsToXml() Tabulation
}

func GetTabulation

func GetTabulation(name, arrayType string) Tabulation

type TokenSemantic

type TokenSemantic interface {
	JSONLookup(token string) (interface{}, error)
	GetAlgorithm() string
	GetArgs() TokenSemanticArgs
	GetKey() string
	GetLocation() string
	GetTransformer() (TokenTransformer, error)
	GetProcessedToken(res response.Response) (interface{}, error)
}

type TokenSemanticArgs

type TokenSemanticArgs map[string]interface{}

func (TokenSemanticArgs) GetRegex

func (tsa TokenSemanticArgs) GetRegex() (string, bool)

type TokenTransformer

type TokenTransformer func(interface{}) (interface{}, error)

type Transform

type Transform interface {
	JSONLookup(token string) (interface{}, error)
	GetAlgorithm() string
}

type TransformerLocator

type TransformerLocator interface {
	GetTransformer(tokenSemantic TokenSemantic) (TokenTransformer, error)
}

func NewStandardTransformerLocator

func NewStandardTransformerLocator() TransformerLocator

type Variations

type Variations interface {
	JSONLookup(token string) (interface{}, error)
	IsObjectSchemaImplicitlyUnioned() bool
}

type View

type View interface {
	GetDDLForSqlDialect(sqlBackend string) (string, bool)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL