store

package
v0.0.0-...-8073d5e Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Username   string
	Password   string
	STOREURL   string
	HUBURL     string
	IgnoreCert bool
	Token      string
	ID         string
}

Client - Is the basic Client struct

func NewBasicAuthClient

func NewBasicAuthClient(username, password, url string, ignoreCert bool) *Client

NewBasicAuthClient - Creates a basic client to connecto the UCP

func ReadToken

func ReadToken() (*Client, error)

ReadToken - Reads the token from a file

func (*Client) Connect

func (c *Client) Connect() error

Connect - Will attempt to connect to UCP

func (*Client) Disconnect

func (c *Client) Disconnect() error

Disconnect - TODO

func (*Client) GetAllSubscriptions

func (c *Client) GetAllSubscriptions(id string) ([]Subscription, error)

GetAllSubscriptions - Retrieves all subscriptions

func (*Client) GetCVEDatabase

func (c *Client) GetCVEDatabase(subscription, dtrSchema string) error

GetCVEDatabase - Retrieves CVE Database

func (*Client) GetLicense

func (c *Client) GetLicense(subscription string) error

GetLicense - Retrieves all subscriptions

func (*Client) GetUserInfo

func (c *Client) GetUserInfo(user string) error

GetUserInfo - Retrieves all subscriptions

func (*Client) WriteToken

func (c *Client) WriteToken() error

WriteToken - Writes a copy of the token to the

type Subscription

type Subscription struct {
	Name               string    `json:"name"`
	SubscriptionID     string    `json:"subscription_id"`
	DockerID           string    `json:"docker_id"`
	ProductID          string    `json:"product_id"`
	CreatedByDockerID  string    `json:"created_by_docker_id"`
	ProductRatePlan    string    `json:"product_rate_plan"`
	ProductRatePlanID  string    `json:"product_rate_plan_id"`
	InitialPeriodStart time.Time `json:"initial_period_start"`
	CurrentPeriodStart time.Time `json:"current_period_start"`
	CurrentPeriodEnd   time.Time `json:"current_period_end"`
	State              string    `json:"state"`
	Eusa               struct {
		Accepted   bool      `json:"accepted"`
		AcceptedBy string    `json:"accepted_by"`
		AcceptedOn time.Time `json:"accepted_on"`
	} `json:"eusa"`
	PricingComponents []struct {
		Name  string `json:"name"`
		Value int    `json:"value"`
	} `json:"pricing_components"`
	MarketingOptIn bool `json:"marketing_opt_in"`
}

Subscription - this is the returned struct from a store query

type UserAccount

type UserAccount struct {
	ID       string `json:"id"`
	Username string `json:"username"`
	FullName string `json:"full_name"`
	Location string `json:"location"`
	Company  string `json:"company"`
	URL      string `json:"profile_url"`
	Type     string `json:"type"`
}

UserAccount - The struct that is returned by interacting with the Docker Store

Jump to

Keyboard shortcuts

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