Documentation
¶
Index ¶
- Constants
- Variables
- func GetDescribeHeader(extended bool) []string
- func GetProviderDocBytes(prov string) ([]byte, error)
- func GetResourcesHeader(extended bool) []string
- func GetResourcesRegisterDocBytes(url string) ([]byte, error)
- func GetServersFromHeirarchy(t *Service, op *OperationStore) openapi3.Servers
- func GetServiceDocBytes(url string) ([]byte, error)
- func GetServicesHeader(extended bool) []string
- func InterfaceToSQLType(val interface{}) (sqltypes.Value, error)
- func ObtainServerURLsFromServers(svs []*openapi3.Server, vars map[string]string) ([]string, error)
- func ProviderTypeConditionIsValid(providerType string, lhs string, rhs interface{}) bool
- func ResourceConditionIsValid(lhs string, rhs interface{}) bool
- func ResourceKeyExists(key string) bool
- func ServiceConditionIsValid(lhs string, rhs interface{}) bool
- func ServiceKeyExists(key string) bool
- type AuthMetadata
- type ColumnDescriptor
- type DiscoveryDoc
- type ExpectedRequest
- type ExpectedResponse
- type GraphQL
- type GraphQLElement
- type ITable
- type Loader
- type MetadataStore
- type MethodSet
- type Methods
- type OperationRef
- func (opr OperationRef) ExtractMethodItem() string
- func (opr OperationRef) ExtractPathItem() string
- func (opr OperationRef) ExtractServiceDocPath() string
- func (value OperationRef) JSONLookup(token string) (interface{}, error)
- func (value *OperationRef) MarshalJSON() ([]byte, error)
- func (value *OperationRef) UnmarshalJSON(data []byte) error
- func (value *OperationRef) Validate(ctx context.Context) error
- type OperationSelector
- type OperationStore
- func (op *OperationStore) DeprecatedProcessResponse(response *http.Response) (map[string]interface{}, error)
- func (m *OperationStore) FilterBy(predicate func(interface{}) (ITable, error)) (ITable, error)
- func (m *OperationStore) GetColumnOrder(extended bool) []string
- func (m *OperationStore) GetKey(lhs string) (interface{}, error)
- func (m *OperationStore) GetKeyAsSqlVal(lhs string) (sqltypes.Value, error)
- func (m *OperationStore) GetName() string
- func (op *OperationStore) GetOperationParameter(key string) (*Parameter, bool)
- func (op *OperationStore) GetOperationParameters() Parameters
- func (op *OperationStore) GetOptimalResponseMediaType() string
- func (m *OperationStore) GetOptionalParameters() map[string]*Parameter
- func (m *OperationStore) GetParameter(paramKey string) (*Parameter, bool)
- func (op *OperationStore) GetParameterizedPath() string
- func (m *OperationStore) GetParameters() map[string]*Parameter
- func (op *OperationStore) GetQueryTransposeAlgorithm() string
- func (op *OperationStore) GetRequestBodyRequiredProperties() ([]string, error)
- func (op *OperationStore) GetRequestBodySchema() (*Schema, error)
- func (m *OperationStore) GetRequiredParameters() map[string]*Parameter
- func (op *OperationStore) GetResponseBodySchemaAndMediaType() (*Schema, string, error)
- func (m *OperationStore) GetSelectItemsKey() string
- func (op *OperationStore) GetSelectSchemaAndObjectPath() (*Schema, string, error)
- func (m *OperationStore) IsAwaitable() bool
- func (op *OperationStore) IsNullary() bool
- func (op *OperationStore) IsRequiredRequestBodyProperty(key string) bool
- func (m *OperationStore) KeyExists(lhs string) bool
- func (op *OperationStore) ParameterMatch(params map[string]interface{}) (map[string]interface{}, bool)
- func (op *OperationStore) Parameterize(prov *Provider, parentDoc *Service, inputParams map[string]interface{}, ...) (*openapi3filter.RequestValidationInput, error)
- func (op *OperationStore) ProcessResponse(response *http.Response) (*response.Response, error)
- func (m *OperationStore) ToPresentationMap(extended bool) map[string]interface{}
- type OperationStoreRef
- type Parameter
- type ParameterSuffixMap
- type Parameters
- type PathItemRef
- type Provider
- func (pr *Provider) Debug() string
- func (pr *Provider) GetProviderService(key string) (*ProviderService, error)
- func (pr *Provider) GetQueryTransposeAlgorithm() string
- func (pr *Provider) GetResourcesShallow(serviceKey string) (*ResourceRegister, error)
- func (pr *Provider) GetService(key string) (*Service, error)
- func (prov Provider) JSONLookup(token string) (interface{}, error)
- func (pr *Provider) MarshalJSON() ([]byte, error)
- func (pr *Provider) ToJson() ([]byte, error)
- func (pr *Provider) ToYaml() ([]byte, error)
- func (pr *Provider) ToYamlFile(filePath string) error
- func (pr *Provider) UnmarshalJSON(data []byte) error
- type ProviderDescription
- type ProviderInfo
- type ProviderService
- func (sv *ProviderService) ConditionIsValid(lhs string, rhs interface{}) bool
- func (ps *ProviderService) FilterBy(predicate func(interface{}) (ITable, error)) (ITable, error)
- func (ps *ProviderService) GetKey(lhs string) (interface{}, error)
- func (ps *ProviderService) GetKeyAsSqlVal(lhs string) (sqltypes.Value, error)
- func (ps *ProviderService) GetName() string
- func (sv *ProviderService) GetQueryTransposeAlgorithm() string
- func (ps *ProviderService) GetRequiredParameters() map[string]*Parameter
- func (ps *ProviderService) GetResourcesShallow() (*ResourceRegister, error)
- func (ps *ProviderService) GetService() (*Service, error)
- func (ps *ProviderService) GetServiceFragment(resourceKey string) (*Service, error)
- func (ps *ProviderService) KeyExists(lhs string) bool
- func (pr *ProviderService) MarshalJSON() ([]byte, error)
- func (ps *ProviderService) PeekServiceFragment(resourceKey string) (*Service, bool)
- func (ps *ProviderService) ToMap() map[string]interface{}
- func (pr *ProviderService) UnmarshalJSON(data []byte) error
- type ProvidersList
- type QueryTranspose
- type Registry
- func (r *Registry) GetDocBytes(docPath string) ([]byte, error)
- func (r *Registry) GetLatestAvailableVersion(providerName string) (string, error)
- func (r *Registry) GetResourcesRegisterDocBytes(url string) ([]byte, error)
- func (r *Registry) GetResourcesShallowFromProvider(pr *Provider, serviceKey string) (*ResourceRegister, error)
- func (r *Registry) GetResourcesShallowFromProviderService(pr *ProviderService) (*ResourceRegister, error)
- func (r *Registry) GetResourcesShallowFromURL(ps *ProviderService) (*ResourceRegister, error)
- func (r *Registry) GetService(ps *ProviderService) (*Service, error)
- func (r *Registry) GetServiceDocBytes(url string) ([]byte, error)
- func (r *Registry) GetServiceFragment(ps *ProviderService, resourceKey string) (*Service, error)
- func (r *Registry) GetServiceFromProviderService(ps *ProviderService) (*Service, error)
- func (r *Registry) ListAllAvailableProviders() (map[string]ProviderDescription, error)
- func (r *Registry) ListAllProviderVersions(prov string) (map[string]ProviderDescription, error)
- func (r *Registry) ListLocallyAvailableProviders() map[string]ProviderDescription
- func (r *Registry) LoadProviderByName(prov string, version string) (*Provider, error)
- func (r *Registry) PullAndPersistProviderArchive(prov string, version string) error
- func (r *Registry) PullProviderArchive(prov string, version string) (io.ReadCloser, error)
- type RegistryAPI
- type RegistryConfig
- type Resource
- func (r *Resource) ConditionIsValid(lhs string, rhs interface{}) bool
- func (r *Resource) FilterBy(predicate func(interface{}) (ITable, error)) (ITable, error)
- func (r *Resource) FindMethod(key string) (*OperationStore, error)
- func (rs *Resource) FindOperationStore(sel OperationSelector) (*OperationStore, error)
- func (rs *Resource) GetDefaultMethodKeysForSQLVerb(sqlVerb string) []string
- func (rs *Resource) GetFirstMethodFromSQLVerb(sqlVerb string) (*OperationStore, string, bool)
- func (rs *Resource) GetFirstMethodMatchFromSQLVerb(sqlVerb string, parameters map[string]interface{}) (*OperationStore, map[string]interface{}, bool)
- func (rs *Resource) GetKey(lhs string) (interface{}, error)
- func (rs *Resource) GetKeyAsSqlVal(lhs string) (sqltypes.Value, error)
- func (rs *Resource) GetMethodsMatched() Methods
- func (rs *Resource) GetName() string
- func (r *Resource) GetQueryTransposeAlgorithm() string
- func (rs *Resource) GetRequiredParameters() map[string]*Parameter
- func (rs *Resource) GetSelectableObject() string
- func (rsc Resource) JSONLookup(token string) (interface{}, error)
- func (rs *Resource) KeyExists(lhs string) bool
- func (rs *Resource) ToMap(extended bool) map[string]interface{}
- type ResourceRegister
- type ResourcesRef
- type ResponseKeys
- type Schema
- func (s *Schema) ConditionIsValid(lhs string, rhs interface{}) bool
- func (s *Schema) DeprecatedProcessHttpResponse(response *http.Response, path string) (map[string]interface{}, error)
- func (s *Schema) FindByPath(path string, visited map[string]bool) *Schema
- func (s *Schema) GetAllColumns() []string
- func (s *Schema) GetItems() (*Schema, error)
- func (sc *Schema) GetItemsSchema() (*Schema, error)
- func (s *Schema) GetName() string
- func (s *Schema) GetProperties() (Schemas, error)
- func (s *Schema) GetProperty(propertyKey string) (*Schema, error)
- func (sc *Schema) GetPropertySchema(key string) (*Schema, error)
- func (schema *Schema) GetSelectListItems(key string) (*Schema, string)
- func (schema *Schema) GetSelectSchema(itemsKey, mediaType string) (*Schema, string, error)
- func (s *Schema) IsArrayRef() bool
- func (s *Schema) IsBoolean() bool
- func (s *Schema) IsFloat() bool
- func (s *Schema) IsIntegral() bool
- func (s *Schema) IsRequired(key string) bool
- func (s *Schema) ProcessHttpResponse(r *http.Response, path string) (*response.Response, error)
- func (s *Schema) Tabulate(omitColumns bool) *Tabulation
- func (s *Schema) ToDescriptionMap(extended bool) map[string]interface{}
- type Schemas
- type Service
- func LoadServiceDocFromBytes(ps *ProviderService, bytes []byte) (*Service, error)
- func LoadServiceDocFromFile(ps *ProviderService, fileName string) (*Service, error)
- func LoadServiceSubsetDocFromBytes(rr *ResourceRegister, resourceKey string, bytes []byte) (*Service, error)
- func NewService(t *openapi3.T) *Service
- func (svc *Service) AsSourceString() string
- func (sv *Service) ConditionIsValid(lhs string, rhs interface{}) bool
- func (sv *Service) FilterBy(predicate func(interface{}) (ITable, error)) (ITable, error)
- func (sv *Service) GetKey(lhs string) (interface{}, error)
- func (sv *Service) GetKeyAsSqlVal(lhs string) (sqltypes.Value, error)
- func (svc *Service) GetName() string
- func (svc *Service) GetQueryTransposeAlgorithm() string
- func (rs *Service) GetRequiredParameters() map[string]*Parameter
- func (svc *Service) GetResource(resourceName string) (*Resource, error)
- func (svc *Service) GetResources() (map[string]*Resource, error)
- func (svc *Service) GetSchema(key string) (*Schema, error)
- func (svc *Service) GetSchemas() (map[string]*Schema, error)
- func (sv *Service) GetT() *openapi3.T
- func (svc *Service) IsPreferred() bool
- func (sv *Service) KeyExists(lhs string) bool
- func (svc *Service) ToJson() ([]byte, error)
- func (svc *Service) ToMap() map[string]interface{}
- func (svc *Service) ToSourceFile(outFile string) error
- func (svc *Service) ToYaml() ([]byte, error)
- func (svc *Service) ToYamlFile(filePath string) error
- type ServiceRef
- type SimpleMockRegistryRoundTripper
- type Tabulation
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" ExtensionKeyQueryParamTranspose string = "x-stackQL-queryParamTranspose" ExtensionKeyProvider string = "x-stackql-provider" ExtensionKeyResources string = "x-stackQL-resources" )
View Source
const ( RequestBodyKeyPrefix string = "data" RequestBodyKeyDelimiter string = "__" RequestBodyBaseKey string = RequestBodyKeyPrefix + RequestBodyKeyDelimiter )
View Source
const (
ConfigFilesMode fs.FileMode = 0664
)
Variables ¶
View Source
var ( IgnoreEmbedded bool OpenapiFileRoot string )
View Source
var (
AnonymousColumnName string = defaultAnonymousColumnName
)
Functions ¶
func GetDescribeHeader ¶
func GetProviderDocBytes ¶
func GetResourcesHeader ¶
func GetServersFromHeirarchy ¶
func GetServersFromHeirarchy(t *Service, op *OperationStore) openapi3.Servers
func GetServiceDocBytes ¶
func GetServicesHeader ¶
func InterfaceToSQLType ¶
func ResourceKeyExists ¶
func ServiceConditionIsValid ¶
func ServiceKeyExists ¶
Types ¶
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 ColumnDescriptor ¶
type ColumnDescriptor struct {
Alias string
Name string
Schema *Schema
DecoratedCol string
Val *sqlparser.SQLVal
}
func NewColumnDescriptor ¶
func (ColumnDescriptor) GetIdentifier ¶
func (cd ColumnDescriptor) GetIdentifier() string
type DiscoveryDoc ¶
type DiscoveryDoc interface {
// contains filtered or unexported methods
}
type ExpectedRequest ¶
type ExpectedResponse ¶
type GraphQL ¶
type GraphQL struct {
ID string `json:"id" yaml:"id"`
Query string `json:"query,omitempty" yaml:"query,omitempty"` // Required
Cursor GraphQLElement `json:"cursor,omitempty" yaml:"cursor,omitempty"`
ReponseSelection GraphQLElement `json:"responseSelection,omitempty" yaml:"responseSelection,omitempty"`
URL string `json:"url" yaml:"url"`
HTTPVerb string `json:"httpVerb" yaml:"httpVerb"`
}
func (*GraphQL) GetCursorJSONPath ¶
func (*GraphQL) GetResponseJSONPath ¶
func (GraphQL) JSONLookup ¶
type GraphQLElement ¶
type GraphQLElement map[string]interface{}
type MetadataStore ¶
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) GetFirstMatch ¶
func (ms MethodSet) GetFirstMatch(params map[string]interface{}) (*OperationStore, map[string]interface{}, bool)
type Methods ¶
type Methods map[string]OperationStore
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 OperationRef ¶
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
type OperationSelector ¶
type OperationSelector struct {
SQLVerb string `json:"sqlVerb" yaml:"sqlVerb"` // Required
// Optional parameters.
Parameters map[string]interface{} `json:"parameters,omitempty" yaml:"parameters,omitempty"`
}
func NewOperationSelector ¶
func NewOperationSelector(slqVerb string, params map[string]interface{}) OperationSelector
type OperationStore ¶
type OperationStore struct {
MethodKey string `json:"-" yaml:"-"`
SQLVerb string `json:"-" yaml:"-"`
GraphQL *GraphQL `json:"-" yaml:"-"`
QueryTranspose *QueryTranspose `json:"-" yaml:"-"`
// Optional parameters.
Parameters map[string]interface{} `json:"parameters,omitempty" yaml:"parameters,omitempty"`
PathItem *openapi3.PathItem `json:"-" yaml:"-"` // Required
APIMethod string `json:"apiMethod" yaml:"apiMethod"` // Required
OperationRef *OperationRef `json:"operation" yaml:"operation"` // Required
PathRef *PathItemRef `json:"path" yaml:"path"` // Deprecated
Request *ExpectedRequest `json:"request" yaml:"request"`
Response *ExpectedResponse `json:"response" yaml:"response"`
Servers *openapi3.Servers `json:"servers" yaml:"servers"`
ProviderService *ProviderService `json:"-" yaml:"-"` // upwards traversal
Provider *Provider `json:"-" yaml:"-"` // upwards traversal
Service *Service `json:"-" yaml:"-"` // upwards traversal
Resource *Resource `json:"-" yaml:"-"` // upwards traversal
// contains filtered or unexported fields
}
func (*OperationStore) DeprecatedProcessResponse ¶
func (op *OperationStore) DeprecatedProcessResponse(response *http.Response) (map[string]interface{}, error)
func (*OperationStore) FilterBy ¶
func (m *OperationStore) FilterBy(predicate func(interface{}) (ITable, error)) (ITable, error)
func (*OperationStore) GetColumnOrder ¶
func (m *OperationStore) GetColumnOrder(extended bool) []string
func (*OperationStore) GetKey ¶
func (m *OperationStore) GetKey(lhs string) (interface{}, error)
func (*OperationStore) GetKeyAsSqlVal ¶
func (m *OperationStore) GetKeyAsSqlVal(lhs string) (sqltypes.Value, error)
func (*OperationStore) GetName ¶
func (m *OperationStore) GetName() string
func (*OperationStore) GetOperationParameter ¶
func (op *OperationStore) GetOperationParameter(key string) (*Parameter, bool)
func (*OperationStore) GetOperationParameters ¶
func (op *OperationStore) GetOperationParameters() Parameters
func (*OperationStore) GetOptimalResponseMediaType ¶
func (op *OperationStore) GetOptimalResponseMediaType() string
func (*OperationStore) GetOptionalParameters ¶
func (m *OperationStore) GetOptionalParameters() map[string]*Parameter
func (*OperationStore) GetParameter ¶
func (m *OperationStore) GetParameter(paramKey string) (*Parameter, bool)
func (*OperationStore) GetParameterizedPath ¶
func (op *OperationStore) GetParameterizedPath() string
func (*OperationStore) GetParameters ¶
func (m *OperationStore) GetParameters() map[string]*Parameter
func (*OperationStore) GetQueryTransposeAlgorithm ¶
func (op *OperationStore) GetQueryTransposeAlgorithm() string
func (*OperationStore) GetRequestBodyRequiredProperties ¶
func (op *OperationStore) GetRequestBodyRequiredProperties() ([]string, error)
func (*OperationStore) GetRequestBodySchema ¶
func (op *OperationStore) GetRequestBodySchema() (*Schema, error)
func (*OperationStore) GetRequiredParameters ¶
func (m *OperationStore) GetRequiredParameters() map[string]*Parameter
func (*OperationStore) GetResponseBodySchemaAndMediaType ¶
func (op *OperationStore) GetResponseBodySchemaAndMediaType() (*Schema, string, error)
func (*OperationStore) GetSelectItemsKey ¶
func (m *OperationStore) GetSelectItemsKey() string
func (*OperationStore) GetSelectSchemaAndObjectPath ¶
func (op *OperationStore) GetSelectSchemaAndObjectPath() (*Schema, string, error)
func (*OperationStore) IsAwaitable ¶
func (m *OperationStore) IsAwaitable() bool
func (*OperationStore) IsNullary ¶
func (op *OperationStore) IsNullary() bool
func (*OperationStore) IsRequiredRequestBodyProperty ¶
func (op *OperationStore) IsRequiredRequestBodyProperty(key string) bool
func (*OperationStore) KeyExists ¶
func (m *OperationStore) KeyExists(lhs string) bool
func (*OperationStore) ParameterMatch ¶
func (op *OperationStore) ParameterMatch(params map[string]interface{}) (map[string]interface{}, bool)
func (*OperationStore) Parameterize ¶
func (op *OperationStore) Parameterize(prov *Provider, parentDoc *Service, inputParams map[string]interface{}, requestBody interface{}) (*openapi3filter.RequestValidationInput, error)
func (*OperationStore) ProcessResponse ¶
func (*OperationStore) ToPresentationMap ¶
func (m *OperationStore) ToPresentationMap(extended bool) map[string]interface{}
type OperationStoreRef ¶
type OperationStoreRef struct {
Ref string `json:"$ref" yaml:"$ref"`
Value *OperationStore
}
type Parameter ¶
func (*Parameter) ConditionIsValid ¶
type ParameterSuffixMap ¶
type ParameterSuffixMap struct {
// contains filtered or unexported fields
}
func MakeSuffixMapFromParameterMap ¶
func MakeSuffixMapFromParameterMap(m map[string]*Parameter) *ParameterSuffixMap
func NewParameterSuffixMap ¶
func NewParameterSuffixMap() *ParameterSuffixMap
func (*ParameterSuffixMap) Delete ¶
func (psm *ParameterSuffixMap) Delete(k string) bool
func (*ParameterSuffixMap) GetAll ¶
func (psm *ParameterSuffixMap) GetAll() map[string]*Parameter
func (*ParameterSuffixMap) Put ¶
func (psm *ParameterSuffixMap) Put(k string, v *Parameter)
func (*ParameterSuffixMap) Size ¶
func (psm *ParameterSuffixMap) Size() int
type Parameters ¶
type Parameters openapi3.Parameters
func (Parameters) GetParameter ¶
func (p Parameters) GetParameter(key string) (*Parameter, bool)
type PathItemRef ¶
type Provider ¶
type Provider struct {
openapi3.ExtensionProps
ResponseKeys
FilePath string `json:"-" yaml:"-"`
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Title string `json:"title" yaml:"title"`
Version string `json:"version" yaml:"version"`
Description string `json:"description,omitempty" yaml:"desription,omitempty"`
ProviderServices map[string]*ProviderService `json:"providerServices,omitempty" yaml:"providerServices,omitempty"`
QueryTranspose *QueryTranspose `json:"queryParamTranspose,omitempty" yaml:"queryParamTranspose,omitempty"`
}
func LoadProviderByName ¶
func LoadProviderDocFromFile ¶
func NewProvider ¶
func (*Provider) GetProviderService ¶
func (pr *Provider) GetProviderService(key string) (*ProviderService, error)
func (*Provider) GetQueryTransposeAlgorithm ¶
func (*Provider) GetResourcesShallow ¶
func (pr *Provider) GetResourcesShallow(serviceKey string) (*ResourceRegister, error)
func (Provider) JSONLookup ¶
func (*Provider) MarshalJSON ¶
func (*Provider) ToYamlFile ¶
func (*Provider) UnmarshalJSON ¶
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 ProviderService ¶
type ProviderService struct {
openapi3.ExtensionProps
ID string `json:"id" yaml:"id"` // Required
Name string `json:"name" yaml:"name"` // Required
Title string `json:"title" yaml:"title"` // Required
Version string `json:"version" yaml:"version"` // Required
Description string `json:"description" yaml:"description"`
Preferred bool `json:"preferred" yaml:"preferred"`
ServiceRef *ServiceRef `json:"service,omitempty" yaml:"service,omitempty"` // will be lazy evaluated
ResourcesRef *ResourcesRef `json:"resources,omitempty" yaml:"resources,omitempty"` // will be lazy evaluated
Provider *Provider `json:"-" yaml:"-"` // upwards traversal
QueryTranspose *QueryTranspose `json:"queryParamTranspose,omitempty" yaml:"queryParamTranspose,omitempty"`
}
func (*ProviderService) ConditionIsValid ¶
func (sv *ProviderService) ConditionIsValid(lhs string, rhs interface{}) bool
func (*ProviderService) FilterBy ¶
func (ps *ProviderService) FilterBy(predicate func(interface{}) (ITable, error)) (ITable, error)
func (*ProviderService) GetKey ¶
func (ps *ProviderService) GetKey(lhs string) (interface{}, error)
func (*ProviderService) GetKeyAsSqlVal ¶
func (ps *ProviderService) GetKeyAsSqlVal(lhs string) (sqltypes.Value, error)
func (*ProviderService) GetName ¶
func (ps *ProviderService) GetName() string
func (*ProviderService) GetQueryTransposeAlgorithm ¶
func (sv *ProviderService) GetQueryTransposeAlgorithm() string
func (*ProviderService) GetRequiredParameters ¶
func (ps *ProviderService) GetRequiredParameters() map[string]*Parameter
func (*ProviderService) GetResourcesShallow ¶
func (ps *ProviderService) GetResourcesShallow() (*ResourceRegister, error)
func (*ProviderService) GetService ¶
func (ps *ProviderService) GetService() (*Service, error)
func (*ProviderService) GetServiceFragment ¶
func (ps *ProviderService) GetServiceFragment(resourceKey string) (*Service, error)
func (*ProviderService) KeyExists ¶
func (ps *ProviderService) KeyExists(lhs string) bool
func (*ProviderService) MarshalJSON ¶
func (pr *ProviderService) MarshalJSON() ([]byte, error)
func (*ProviderService) PeekServiceFragment ¶
func (ps *ProviderService) PeekServiceFragment(resourceKey string) (*Service, bool)
func (*ProviderService) ToMap ¶
func (ps *ProviderService) ToMap() map[string]interface{}
func (*ProviderService) UnmarshalJSON ¶
func (pr *ProviderService) UnmarshalJSON(data []byte) error
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 QueryTranspose ¶
type QueryTranspose struct {
Algorithm string `json:"algorithm,omitempty" yaml:"algorithm,omitempty"`
}
func (QueryTranspose) JSONLookup ¶
func (qt QueryTranspose) JSONLookup(token string) (interface{}, error)
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func (*Registry) GetLatestAvailableVersion ¶
func (*Registry) GetResourcesRegisterDocBytes ¶
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 (*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 (*Registry) PullAndPersistProviderArchive ¶
func (*Registry) PullProviderArchive ¶
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)
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 struct {
ID string `json:"id" yaml:"id"` // Required
Name string `json:"name" yaml:"name"` // Required
Title string `json:"title" yaml:"title"` // Required
Description string `json:"description,omitempty" yaml:"desription,omitempty"`
SelectorAlgorithm string `json:"selectorAlgorithm,omitempty" yaml:"selectorAlgorithm,omitempty"`
Methods Methods `json:"methods" yaml:"methods"`
ServiceDocPath *ServiceRef `json:"serviceDoc,omitempty" yaml:"serviceDoc,omitempty"`
SQLVerbs map[string][]OperationStoreRef `json:"sqlVerbs" yaml:"sqlVerbs"`
BaseUrl string `json:"baseUrl,omitempty" yaml:"baseUrl,omitempty"` // hack
QueryTranspose *QueryTranspose `json:"queryParamTranspose,omitempty" yaml:"queryParamTranspose,omitempty"`
Service *Service `json:"-" yaml:"-"` // upwards traversal
ProviderService *ProviderService `json:"-" yaml:"-"` // upwards traversal
Provider *Provider `json:"-" yaml:"-"` // upwards traversal
}
func (*Resource) ConditionIsValid ¶
func (*Resource) FindMethod ¶
func (r *Resource) FindMethod(key string) (*OperationStore, error)
func (*Resource) FindOperationStore ¶
func (rs *Resource) FindOperationStore(sel OperationSelector) (*OperationStore, error)
func (*Resource) GetDefaultMethodKeysForSQLVerb ¶
func (*Resource) GetFirstMethodFromSQLVerb ¶
func (rs *Resource) GetFirstMethodFromSQLVerb(sqlVerb string) (*OperationStore, string, bool)
func (*Resource) GetFirstMethodMatchFromSQLVerb ¶
func (*Resource) GetKeyAsSqlVal ¶
func (*Resource) GetMethodsMatched ¶
func (*Resource) GetQueryTransposeAlgorithm ¶
func (*Resource) GetRequiredParameters ¶
func (*Resource) GetSelectableObject ¶
func (Resource) JSONLookup ¶
type ResourceRegister ¶
type ResourceRegister struct {
ServiceDocPath *ServiceRef `json:"serviceDoc,omitempty" yaml:"serviceDoc,omitempty"`
Resources map[string]*Resource `json:"resources,omitempty" yaml:"resources,omitempty"`
ProviderService *ProviderService `json:"-" yaml:"-"` // upwards traversal
Provider *Provider `json:"-" yaml:"-"` // upwards traversal
}
func LoadResourcesShallow ¶
func LoadResourcesShallow(ps *ProviderService, bt []byte) (*ResourceRegister, error)
func NewResourceRegister ¶
func NewResourceRegister() *ResourceRegister
func (*ResourceRegister) ObtainServiceDocUrl ¶
func (rr *ResourceRegister) ObtainServiceDocUrl(resourceKey string) string
type ResourcesRef ¶
type ResourcesRef struct {
Ref string `json:"$ref" yaml:"$ref"`
Value *ResourceRegister
}
type ResponseKeys ¶
type Schema ¶
func (*Schema) ConditionIsValid ¶
func (*Schema) DeprecatedProcessHttpResponse ¶
func (*Schema) FindByPath ¶
func (*Schema) GetAllColumns ¶
func (*Schema) GetItemsSchema ¶
func (*Schema) GetProperties ¶
func (*Schema) GetSelectListItems ¶
func (*Schema) GetSelectSchema ¶
func (*Schema) IsArrayRef ¶
func (*Schema) IsIntegral ¶
func (*Schema) IsRequired ¶
func (*Schema) ProcessHttpResponse ¶
func (*Schema) Tabulate ¶
func (s *Schema) Tabulate(omitColumns bool) *Tabulation
func (*Schema) ToDescriptionMap ¶
type Service ¶
type Service struct {
*openapi3.T
QueryTranspose *QueryTranspose `json:"-" yaml:"-"`
ProviderService *ProviderService `json:"-" yaml:"-"` // upwards traversal
Provider *Provider `json:"-" yaml:"-"` // upwards traversal
// contains filtered or unexported fields
}
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 (*Service) AsSourceString ¶
func (*Service) ConditionIsValid ¶
func (*Service) GetKeyAsSqlVal ¶
func (*Service) GetQueryTransposeAlgorithm ¶
func (*Service) GetRequiredParameters ¶
func (*Service) GetResource ¶
func (*Service) IsPreferred ¶
func (*Service) ToSourceFile ¶
func (*Service) ToYamlFile ¶
type ServiceRef ¶
type SimpleMockRegistryRoundTripper ¶
type SimpleMockRegistryRoundTripper struct {
// contains filtered or unexported fields
}
func NewSimpleMockRegistryRoundTripper ¶
func NewSimpleMockRegistryRoundTripper(fileRoot string, registryRoot *url.URL) *SimpleMockRegistryRoundTripper
type Tabulation ¶
type Tabulation struct {
// contains filtered or unexported fields
}
func GetTabulation ¶
func GetTabulation(name, arrayType string) Tabulation
func (*Tabulation) GetColumns ¶
func (t *Tabulation) GetColumns() []ColumnDescriptor
func (*Tabulation) GetName ¶
func (t *Tabulation) GetName() string
func (*Tabulation) PushBackColumn ¶
func (t *Tabulation) PushBackColumn(col ColumnDescriptor)
func (*Tabulation) RenameColumnsToXml ¶
func (t *Tabulation) RenameColumnsToXml() *Tabulation
Click to show internal directories.
Click to hide internal directories.