Documentation ¶
Index ¶
- Constants
- type AllApis
- type AllPlans
- type AllSpecs
- type AllSubs
- type GraviteeClient
- func (a *GraviteeClient) CreateApp(appli *models.App) (*models.App, error)
- func (a *GraviteeClient) CreatePlan(apiId string, plan *models.Plan) (*models.Plan, error)
- func (a *GraviteeClient) DeployApi(apiID string) error
- func (a *GraviteeClient) GetAPIKey(subsId, appId string) ([]models.AppCredentials, error)
- func (a *GraviteeClient) GetApi(apiID string) (api *models.Api, error error)
- func (a *GraviteeClient) GetApis() ([]models.Api, error)
- func (a *GraviteeClient) GetApp(id string) (app *models.App, err error)
- func (a *GraviteeClient) GetApps() ([]models.App, error)
- func (a *GraviteeClient) GetConfig() *config.GraviteeConfig
- func (a *GraviteeClient) GetEnvId() string
- func (a *GraviteeClient) GetOrgId() string
- func (a *GraviteeClient) GetSpecificSubscription(subsId, appId string) (*models.Subscriptions, error)
- func (a *GraviteeClient) GetSpecs(apiID string) (specs []models.Spec, error error)
- func (a *GraviteeClient) GetSubscriptions(appid string) ([]models.Subscriptions, error)
- func (a *GraviteeClient) IsReady() bool
- func (a *GraviteeClient) ListAPIsPlans(apiId string) ([]models.Plan, error)
- func (a *GraviteeClient) PublishaPlan(apiId, planId string) error
- func (a *GraviteeClient) RemoveAPIKey(appId, subsId, apikeyId string) error
- func (a *GraviteeClient) RemoveApp(appId string) error
- func (a *GraviteeClient) SubscribetoAnAPI(appId, planId string) (*models.Subscriptions, error)
- func (a *GraviteeClient) TransferSubs(apiId, subId, newPlanId string) (*models.Subscriptions, error)
- func (a *GraviteeClient) UpdateCredential(appId, subId string) error
- type PolicyDetail
- type PortalData
- type PortalResponse
- type PortalsResponse
- type RequestOption
- func WithBody(body []byte) RequestOption
- func WithDefaultHeaders() RequestOption
- func WithHeader(name, value string) RequestOption
- func WithHeaders(headers map[string]string) RequestOption
- func WithQueryParam(name, value string) RequestOption
- func WithQueryParams(queryParams map[string]string) RequestOption
- func WithStringBody(body string) RequestOption
- func WithToken(token string) RequestOption
- type VirtualHosts
Constants ¶
const (
ClonedProdAttribute = "ClonedProduct"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllApis ¶
type AllApis struct { Apis []models.Api `json:"data"` Pagination models.Pagination `json:"pagination"` }
type AllSpecs ¶
type AllSpecs struct { Specs []models.Spec `json:"pages"` Pagination models.Pagination `json:"pagination"` }
type AllSubs ¶
type AllSubs struct {
Subs []models.Subscriptions `json:"data"`
}
type GraviteeClient ¶
GraviteeClient - Represents the Gateway client
func NewClient ¶
func NewClient(graviteeCfg *config.GraviteeConfig) (*GraviteeClient, error)
NewClient - Creates a new Gateway Client
func (*GraviteeClient) CreatePlan ¶
func (*GraviteeClient) DeployApi ¶
func (a *GraviteeClient) DeployApi(apiID string) error
func (*GraviteeClient) GetAPIKey ¶
func (a *GraviteeClient) GetAPIKey(subsId, appId string) ([]models.AppCredentials, error)
GetAPIKey - Request to get the api key assigned to your subscription
func (*GraviteeClient) GetApi ¶
func (a *GraviteeClient) GetApi(apiID string) (api *models.Api, error error)
GetApi - get details of the api
func (*GraviteeClient) GetApis ¶
func (a *GraviteeClient) GetApis() ([]models.Api, error)
GetListAPIs - get the list of APIs
func (*GraviteeClient) GetApp ¶
func (a *GraviteeClient) GetApp(id string) (app *models.App, err error)
GetApp - Get an Application by id
func (*GraviteeClient) GetApps ¶
func (a *GraviteeClient) GetApps() ([]models.App, error)
GetApps - Get all Applications
func (*GraviteeClient) GetConfig ¶
func (a *GraviteeClient) GetConfig() *config.GraviteeConfig
GetConfig - return the gravitee client config
func (*GraviteeClient) GetEnvId ¶
func (a *GraviteeClient) GetEnvId() string
GetEnvId - get the developer id to be used when creating apps
func (*GraviteeClient) GetOrgId ¶
func (a *GraviteeClient) GetOrgId() string
func (*GraviteeClient) GetSpecificSubscription ¶
func (a *GraviteeClient) GetSpecificSubscription(subsId, appId string) (*models.Subscriptions, error)
GetSpecificSubscription - Request to get the API's subscription by its identifier
func (*GraviteeClient) GetSpecs ¶
func (a *GraviteeClient) GetSpecs(apiID string) (specs []models.Spec, error error)
func (*GraviteeClient) GetSubscriptions ¶
func (a *GraviteeClient) GetSubscriptions(appid string) ([]models.Subscriptions, error)
GetSubscriptions - Request to list subscriptions for a given API
func (*GraviteeClient) IsReady ¶
func (a *GraviteeClient) IsReady() bool
IsReady - returns true when the gravitee client authenticates
func (*GraviteeClient) ListAPIsPlans ¶
func (a *GraviteeClient) ListAPIsPlans(apiId string) ([]models.Plan, error)
func (*GraviteeClient) PublishaPlan ¶
func (a *GraviteeClient) PublishaPlan(apiId, planId string) error
func (*GraviteeClient) RemoveAPIKey ¶
func (a *GraviteeClient) RemoveAPIKey(appId, subsId, apikeyId string) error
GetAPIKey - Request to get the api key assigned to your subscription
func (*GraviteeClient) RemoveApp ¶
func (a *GraviteeClient) RemoveApp(appId string) error
func (*GraviteeClient) SubscribetoAnAPI ¶
func (a *GraviteeClient) SubscribetoAnAPI(appId, planId string) (*models.Subscriptions, error)
SubscribetoAnAPI - Request for your application to subscribe to an api
func (*GraviteeClient) TransferSubs ¶
func (a *GraviteeClient) TransferSubs(apiId, subId, newPlanId string) (*models.Subscriptions, error)
func (*GraviteeClient) UpdateCredential ¶
func (a *GraviteeClient) UpdateCredential(appId, subId string) error
type PolicyDetail ¶
type PolicyDetail struct {
PolicyType string `json:"policyType"`
}
type PortalData ¶
type PortalData struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` CustomDomain string `json:"customDomain"` OrgName string `json:"orgName"` Status string `json:"status"` VisibleToCustomers bool `json:"visibleToCustomers"` HTTPS bool `json:"https"` DefaultDomain string `json:"defaultDomain"` CustomeDomainEnabled bool `json:"customDomainEnabled"` DefaultURL string `json:"defaultURL"` CurrentURL string `json:"currentURL"` CurrentDomain string `json:"currentDomain"` }
type PortalResponse ¶
type PortalResponse struct { Status string `json:"status"` Message string `json:"message"` Code string `json:"code"` ErrorCode string `json:"error_code"` RequestID string `json:"request_id"` Data PortalData `json:"data"` }
PortalResponse
type PortalsResponse ¶
type PortalsResponse struct { Status string `json:"status"` Message string `json:"message"` Code string `json:"code"` ErrorCode string `json:"error_code"` RequestID string `json:"request_id"` Data []PortalData `json:"data"` }
PortalsResponse
type RequestOption ¶
type RequestOption func(*graviteeRequest)
func WithDefaultHeaders ¶
func WithDefaultHeaders() RequestOption
WithDefaultHeaders - add the default headers needed for gravitee
func WithHeader ¶
func WithHeader(name, value string) RequestOption
WithHeader - add an additional header to the request
func WithHeaders ¶
func WithHeaders(headers map[string]string) RequestOption
WithHeaders - add additional headers to the request
func WithQueryParam ¶
func WithQueryParam(name, value string) RequestOption
WithQueryParam - add a query parameter to the request
func WithQueryParams ¶
func WithQueryParams(queryParams map[string]string) RequestOption
WithQueryParams - add query parameters to the request
func WithStringBody ¶
func WithStringBody(body string) RequestOption
WithStringBody - add a JSON body, from a string, to the request
func WithToken ¶
func WithToken(token string) RequestOption