resources

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sync

func Sync(cr CloudResource) error

Sync makes a request to cloud api for a resource and then writes the response to the resources cache

Types

type CloudResource

type CloudResource interface {
	// Endpoint returns the API endpoint associated with this cloud resource
	Endpoint() string
	// UnmarshalToCache unmarshals to the resource's underlying cache
	// TODO use stream not []byte for efficiency
	UnmarshalToCache(bytes []byte) error
	// IsEqual compares a spec to it's parent object spec
	IsEqual(spec interface{}, parentSpecObj interface{}) (bool, error)
}

CloudResource defines an interface for resources to adhere to in order to be kept in sync with Containership Cloud

type CsPlugins

type CsPlugins struct {
	// contains filtered or unexported fields
}

CsPlugins defines the Containership Cloud Plugins resource

func NewCsPlugins

func NewCsPlugins() *CsPlugins

NewCsPlugins constructs a new CsPlugins

func (*CsPlugins) Cache

func (us *CsPlugins) Cache() []containershipv3.PluginSpec

Cache return the containership plugins cache

func (CsPlugins) Endpoint

func (cr CsPlugins) Endpoint() string

func (*CsPlugins) IsEqual

func (us *CsPlugins) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)

IsEqual compares a PluginSpec to another Plugin

func (*CsPlugins) UnmarshalToCache

func (us *CsPlugins) UnmarshalToCache(bytes []byte) error

UnmarshalToCache take the json returned from containership api and writes it to CsPlugins cache

type CsRegistries

type CsRegistries struct {
	// contains filtered or unexported fields
}

CsRegistries defines the Containership Cloud CsRegistries resource

func NewCsRegistries

func NewCsRegistries() *CsRegistries

NewCsRegistries constructs a new CsRegistries

func (*CsRegistries) Cache

Cache returns CsRegistries cache

func (CsRegistries) Endpoint

func (cr CsRegistries) Endpoint() string

func (*CsRegistries) GetAuthToken

GetAuthToken return the AuthToken Generated by the registry generator

func (*CsRegistries) IsEqual

func (rs *CsRegistries) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)

IsEqual take a Registry Spec and compares it to a Registry to see if they are the same, returns an error if the objects are of the inforect type

func (*CsRegistries) UnmarshalToCache

func (rs *CsRegistries) UnmarshalToCache(bytes []byte) error

UnmarshalToCache take the json returned from containership api and writes it to CsRegistries cache

type CsUsers

type CsUsers struct {
	// contains filtered or unexported fields
}

CsUsers defines the Containership Cloud Users resource

func NewCsUsers

func NewCsUsers() *CsUsers

NewCsUsers constructs a new CsUsers

func (*CsUsers) Cache

func (us *CsUsers) Cache() []containershipv3.UserSpec

Cache return the containership users cache

func (CsUsers) Endpoint

func (cr CsUsers) Endpoint() string

func (*CsUsers) IsEqual

func (us *CsUsers) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)

IsEqual compares a UserSpec to another User

func (*CsUsers) UnmarshalToCache

func (us *CsUsers) UnmarshalToCache(bytes []byte) error

UnmarshalToCache take the json returned from containership api and writes it to CsUsers cache

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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