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 ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 GithubContent ¶
type GithubContent struct {
Repo string `json:"repo"`
Path string `json:"path"`
Ref string `json:"ref"`
Files []GithubFile `json:"files"`
}
type GithubFile ¶
type GraphQLClient ¶
GraphQLClient is a client for the graphql Payload API
func NewGraphqlClient ¶
NewGraphqlClient builds a new client using a viper instance
func (*GraphQLClient) GetRelease ¶
func (c *GraphQLClient) GetRelease(selector *Selector) (*ShipRelease, error)
GetRelease gets a payload from the graphql server
func (*GraphQLClient) GetSlugRelease ¶ added in v0.35.0
func (c *GraphQLClient) GetSlugRelease(selector *Selector) (*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 Resolver ¶
type Resolver interface {
ResolveAppRelease(
ctx context.Context,
selector *Selector,
app apptype.LocalAppCopy,
) (*api.Release, error)
FetchRelease(
ctx context.Context,
selector *Selector,
) (*ShipRelease, error)
RegisterInstall(
ctx context.Context,
selector Selector,
release *api.Release,
) error
SetRunbook(
runbook string,
)
}
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 ShipRelease ¶
type ShipRelease struct {
ID string `json:"id"`
ChannelID string `json:"channelId"`
ChannelName string `json:"channelName"`
ChannelIcon string `json:"channelIcon"`
Semver string `json:"semver"`
ReleaseNotes string `json:"releaseNotes"`
Spec string `json:"spec"`
Images []Image `json:"images"`
GithubContents []GithubContent `json:"githubContents"`
Created string `json:"created"` // TODO: this time is not in RFC 3339 format
RegistrySecret string `json:"registrySecret"`
Entitlements api.Entitlements `json:"entitlements"`
}
ShipRelease is the release response form GQL
func (*ShipRelease) ToReleaseMeta ¶
func (r *ShipRelease) ToReleaseMeta() api.ReleaseMetadata
ToReleaseMeta linter
type ShipReleaseWrapper ¶
type ShipReleaseWrapper struct {
ShipRelease ShipRelease `json:"shipRelease"`
}
ShipReleaseWrapper wraps the release response form GQL
type ShipSlugReleaseWrapper ¶ added in v0.35.0
type ShipSlugReleaseWrapper struct {
ShipSlugRelease ShipRelease `json:"shipSlugRelease"`
}
ShipSlugReleaseWrapper wraps the release response form GQL