Documentation ¶
Overview ¶
local.go has methods for resolving a local ship.yaml file, and patching in api.Release info that would usually be returned by pg.replicated.com
Index ¶
- Constants
- type GQLGetLicenseResponse
- type GQLGetReleaseResponse
- type GQLGetSlugReleaseResponse
- type GQLRegisterInstallResponse
- type GraphQLClient
- func (c *GraphQLClient) GetLicense(selector *Selector) (*license, error)
- func (c *GraphQLClient) GetRelease(selector *Selector) (*state.ShipRelease, error)
- func (c *GraphQLClient) GetSlugRelease(selector *Selector) (*state.ShipRelease, error)
- func (c *GraphQLClient) RegisterInstall(customerID, installationID, channelID, releaseID string) error
- type GraphQLError
- type GraphQLRequest
- type LicenseWrapper
- type Resolver
- type Selector
- type ShipReleaseWrapper
- type ShipSlugReleaseWrapper
Constants ¶
const GetAppspecQuery = ` query($semver: String) { shipRelease (semver: $semver) { ` + ShipRelease + ` } }`
const GetLicenseQuery = `` /* 127-byte string literal not displayed */
const GetSlugAppSpecQuery = ` query($appSlug: String!, $licenseID: String, $releaseID: String, $semver: String) { shipSlugRelease (appSlug: $appSlug, licenseID: $licenseID, releaseID: $releaseID, semver: $semver) { ` + ShipRelease + ` } }`
const RegisterInstallQuery = `` /* 134-byte string literal not displayed */
const ShipRelease = `` /* 684-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GQLGetLicenseResponse ¶ added in v0.47.0
type GQLGetLicenseResponse struct { Data LicenseWrapper `json:"data,omitempty"` Errors []GraphQLError `json:"errors,omitempty"` }
GQLLicenseResponse is the top-level response object from the graphql server
type GQLGetReleaseResponse ¶
type GQLGetReleaseResponse struct { Data ShipReleaseWrapper `json:"data,omitempty"` Errors []GraphQLError `json:"errors,omitempty"` }
GQLGetReleaseResponse is the top-level response object from the graphql server
type GQLGetSlugReleaseResponse ¶ added in v0.35.0
type GQLGetSlugReleaseResponse struct { Data ShipSlugReleaseWrapper `json:"data,omitempty"` Errors []GraphQLError `json:"errors,omitempty"` }
GQLGetSlugReleaseResponse is the top-level response object from the graphql server
type GQLRegisterInstallResponse ¶
type GQLRegisterInstallResponse struct { Data struct { ShipRegisterInstall bool `json:"shipRegisterInstall"` } `json:"data,omitempty"` Errors []GraphQLError `json:"errors,omitempty"` }
GQLRegisterInstallResponse is the top-level response object from the graphql server
type GraphQLClient ¶
GraphQLClient is a client for the graphql Payload API
func NewGraphqlClient ¶
NewGraphqlClient builds a new client using a viper instance
func (*GraphQLClient) GetLicense ¶ added in v0.47.0
func (c *GraphQLClient) GetLicense(selector *Selector) (*license, error)
func (*GraphQLClient) GetRelease ¶
func (c *GraphQLClient) GetRelease(selector *Selector) (*state.ShipRelease, error)
GetRelease gets a payload from the graphql server
func (*GraphQLClient) GetSlugRelease ¶ added in v0.35.0
func (c *GraphQLClient) GetSlugRelease(selector *Selector) (*state.ShipRelease, error)
GetSlugRelease gets a release from the graphql server by app slug
func (*GraphQLClient) RegisterInstall ¶
func (c *GraphQLClient) RegisterInstall(customerID, installationID, channelID, releaseID string) error
type GraphQLError ¶
type GraphQLError struct { Locations []map[string]interface{} `json:"locations"` Message string `json:"message"` Code string `json:"code"` }
GraphQLError represents an error returned by the graphql server
type GraphQLRequest ¶
type GraphQLRequest struct { Query string `json:"query"` Variables map[string]string `json:"variables"` OperationName string `json:"operationName"` }
GraphQLRequest is a json-serializable request to the graphql server
type LicenseWrapper ¶ added in v0.47.0
type LicenseWrapper struct {
License license `json:"license"`
}
ShipReleaseWrapper wraps the release response form GQL
type Resolver ¶
type Resolver interface { ResolveAppRelease( ctx context.Context, selector *Selector, app apptype.LocalAppCopy, ) (*api.Release, error) FetchRelease( ctx context.Context, selector *Selector, ) (*state.ShipRelease, error) RegisterInstall( ctx context.Context, selector Selector, release *api.Release, ) error SetRunbook( runbook string, ) ResolveEditRelease( ctx context.Context, ) (*api.Release, error) }
type Selector ¶
type Selector struct { // required CustomerID string `url:"customer_id,omitempty"` InstallationID string `url:"installation_id,omitempty"` // OR AppSlug string `url:"AppSlug,omitempty"` // optional Upstream string `url:"upstream,omitempty"` ReleaseID string `url:"release_id,omitempty"` // NOTE: this is unused ReleaseSemver string `url:"release_semver,omitempty"` LicenseID string `url:"license_id,omitempty"` }
Selector selects a replicated.app spec from the Vendor's releases and channels. See pkg/cli/root.go for some more info on which are required and why.
note that `url` struct tags are only for serialize, they don't work for deserialize
func (*Selector) GetBasicAuthUsername ¶ added in v0.37.0
type ShipReleaseWrapper ¶
type ShipReleaseWrapper struct {
ShipRelease state.ShipRelease `json:"shipRelease"`
}
ShipReleaseWrapper wraps the release response form GQL
type ShipSlugReleaseWrapper ¶ added in v0.35.0
type ShipSlugReleaseWrapper struct {
ShipSlugRelease state.ShipRelease `json:"shipSlugRelease"`
}
ShipSlugReleaseWrapper wraps the release response form GQL