shipclient

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArchiveChannel

func ArchiveChannel(appID string, channelID string) error

func GetChannel

func GetChannel(appID string, channelID string) (interface{}, []interface{}, error)

Types

type AppOptions

type AppOptions struct {
	Name string
}

type ChannelOptions

type ChannelOptions struct {
	Name        string
	Description string
}

type Client

type Client interface {
	ListApps() ([]types.AppAndChannels, error)
	GetApp(appID string) (*types.App, error)

	ListChannels(string) ([]types.Channel, error)
	CreateChannel(string, string, string) error

	ListReleases(appID string) ([]types.ReleaseInfo, error)
	CreateRelease(appID string, yaml string) (*types.ReleaseInfo, error)
	UpdateRelease(appID string, sequence int64, yaml string) error
	PromoteRelease(appID string, sequence int64, label string, notes string, channelIDs ...string) error
	LintRelease(string, string) ([]types.LintMessage, error)
}

func NewGraphQLClient

func NewGraphQLClient(origin string, apiKey string) Client

type GraphQLClient

type GraphQLClient struct {
	GQLServer *url.URL
	Token     string
}

GraphQLClient communicates with the Replicated Vendor GraphQL API.

func (*GraphQLClient) CreateChannel

func (c *GraphQLClient) CreateChannel(appID string, name string, description string) error

func (*GraphQLClient) CreateRelease

func (c *GraphQLClient) CreateRelease(appID string, yaml string) (*types.ReleaseInfo, error)

func (*GraphQLClient) GetApp

func (c *GraphQLClient) GetApp(appID string) (*types.App, error)

func (*GraphQLClient) LintRelease added in v0.8.0

func (c *GraphQLClient) LintRelease(appID string, yaml string) ([]types.LintMessage, error)

func (*GraphQLClient) ListApps

func (c *GraphQLClient) ListApps() ([]types.AppAndChannels, error)

func (*GraphQLClient) ListChannels

func (c *GraphQLClient) ListChannels(appID string) ([]types.Channel, error)

func (*GraphQLClient) ListReleases

func (c *GraphQLClient) ListReleases(appID string) ([]types.ReleaseInfo, error)

func (*GraphQLClient) PromoteRelease

func (c *GraphQLClient) PromoteRelease(appID string, sequence int64, label string, notes string, channelIDs ...string) error

func (*GraphQLClient) UpdateRelease

func (c *GraphQLClient) UpdateRelease(appID string, sequence int64, yaml 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,omitempty"`
	Variables     map[string]interface{} `json:"variables"`
	OperationName string                 `json:"operationName"`
}

GraphQLRequest is a json-serializable request to the graphql server

type GraphQLResponseCreateRelease

type GraphQLResponseCreateRelease struct {
	Data   *ShipReleaseCreateData `json:"data,omitempty"`
	Errors []GraphQLError         `json:"errors,omitempty"`
}

type GraphQLResponseErrorOnly

type GraphQLResponseErrorOnly struct {
	Errors []GraphQLError `json:"errors,omitempty"`
}

type GraphQLResponseLintRelease added in v0.8.0

type GraphQLResponseLintRelease struct {
	Data   *ShipReleaseLintData `json:"data,omitempty"`
	Errors []GraphQLError       `json:"errors,omitempty"`
}

type GraphQLResponseListApps

type GraphQLResponseListApps struct {
	Data   *ShipData      `json:"data,omitempty"`
	Errors []GraphQLError `json:"errors,omitempty"`
}

type GraphQLResponseListChannels

type GraphQLResponseListChannels struct {
	Data   *ShipChannelData `json:"data,omitempty"`
	Errors []GraphQLError   `json:"errors,omitempty"`
}

type GraphQLResponseListReleases

type GraphQLResponseListReleases struct {
	Data   *ShipReleasesData `json:"data,omitempty"`
	Errors []GraphQLError    `json:"errors,omitempty"`
}

type ShipApp

type ShipApp struct {
	ID       string        `json:"id"`
	Name     string        `json:"name"`
	Slug     string        `json:"slug"`
	Channels []ShipChannel `json:"channel"`
}

type ShipAppsData

type ShipAppsData struct {
	ShipApps []*ShipApp `json:"apps"`
}

type ShipChannel

type ShipChannel struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`

	CurrentSequence int64  `json:"currentSequence"`
	CurrentVersion  string `json:"currentVersion"`
}

type ShipChannelData

type ShipChannelData struct {
	ShipChannels []*ShipChannel `json:"getAppChannels"`
}

type ShipData

type ShipData struct {
	Ship *ShipAppsData `json:"ship"`
}

type ShipError

type ShipError interface {
	GraphQLError() []GraphQLError
}

type ShipLintLinePosition added in v0.8.0

type ShipLintLinePosition struct {
	Position int64 `json:"position"`
	Line     int64 `json:"line"`
	Column   int64 `json:"column"`
}

type ShipLintMessage added in v0.8.0

type ShipLintMessage struct {
	Rule      string              `json:"rule"`
	Type      string              `json:"type"`
	Positions []*ShipLintPosition `json:"positions"`
}

type ShipLintPosition added in v0.8.0

type ShipLintPosition struct {
	Path  string                `json:"path"`
	Start *ShipLintLinePosition `json:"start"`
	End   *ShipLintLinePosition `json:"end"`
}

type ShipRelease

type ShipRelease struct {
	ID           string `json:"id"`
	Sequence     int64  `json:"sequence"`
	CreatedAt    string `json:"created"`
	ReleaseNotes string `json:"releaseNotes"`
}

type ShipReleaseCreateData

type ShipReleaseCreateData struct {
	ShipRelease *ShipRelease `json:"createRelease"`
}

type ShipReleaseLintData added in v0.8.0

type ShipReleaseLintData struct {
	Messages []*ShipLintMessage `json:"lintRelease"`
}

type ShipReleasesData

type ShipReleasesData struct {
	ShipReleases []*ShipRelease `json:"allReleases"`
}

Jump to

Keyboard shortcuts

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