monocular

package module
v0.0.0-...-ab1e0d7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(portalProxy api.PortalProxy) (api.StratosPlugin, error)

Init creates a new Monocular

func Up20190307115301

func Up20190307115301(txn *sql.Tx) error

func Up20200206090600

func Up20200206090600(txn *sql.Tx) error

func Up20200819184800

func Up20200819184800(txn *sql.Tx) error

func Up20201007113503

func Up20201007113503(txn *sql.Tx) error

Types

type APIListResponse

type APIListResponse []*APIResponse

APIListResponse is an API response in list format

type APIResponse

type APIResponse struct {
	ID            string      `json:"id"`
	Type          string      `json:"type"`
	Attributes    interface{} `json:"attributes"`
	Links         interface{} `json:"links"`
	Relationships RelMap      `json:"relationships"`
}

APIResponse is an API response in non-list format

type BodyAPIListResponse

type BodyAPIListResponse struct {
	Data *APIListResponse `json:"data"`
	Meta Meta             `json:"meta,omitempty"`
}

BodyAPIListResponse is an API body response in list format including the number of results pages

type BodyAPIResponse

type BodyAPIResponse struct {
	Data APIResponse `json:"data"`
}

BodyAPIResponse is an API body response in non-list format

type Chart

type Chart struct {
	ID              string            `json:"-"`
	Name            string            `json:"name"`
	Repo            Repo              `json:"repo"`
	Description     string            `json:"description"`
	Home            string            `json:"home"`
	Keywords        []string          `json:"keywords"`
	Maintainers     []ChartMaintainer `json:"maintainers"`
	Sources         []string          `json:"sources"`
	Icon            string            `json:"icon"`
	RawIcon         []byte            `json:"-"`
	IconContentType string            `json:"-"`
	ChartVersions   []ChartVersion    `json:"-"`
}

Chart is a higher-level representation of a chart package

type ChartMaintainer

type ChartMaintainer struct {
	// Name is a user name or organization name
	Name string `json:"name,omitempty"`
	// Email is an optional email address to contact the named maintainer
	Email string `json:"email,omitempty"`
	// URL is an optional URL to an address for the named maintainer
	URL string `json:"url,omitempty"`
}

ChartMaintainer describes a Chart maintainer.

type ChartMetadata

type ChartMetadata struct {
	// The name of the chart
	Name string `json:"name,omitempty"`
	// The URL to a relevant project page, git repo, or contact person
	Home string `json:"home,omitempty"`
	// Source is the URL to the source code of this chart
	Sources []string `json:"sources,omitempty"`
	// A SemVer 2 conformant version string of the chart
	Version string `json:"version,omitempty"`
	// A one-sentence description of the chart
	Description string `json:"description,omitempty"`
	// A list of string keywords
	Keywords []string `json:"keywords,omitempty"`
	// A list of name and URL/email address combinations for the maintainer(s)
	Maintainers []*ChartMaintainer `json:"maintainers,omitempty"`
	// The URL to an icon file.
	Icon string `json:"icon,omitempty"`
	// The API Version of this chart.
	APIVersion string `json:"apiVersion,omitempty"`
	// The condition to check to enable chart
	Condition string `json:"condition,omitempty"`
	// The tags to check to enable chart
	Tags string `json:"tags,omitempty"`
	// The version of the application enclosed inside of this chart.
	AppVersion string `json:"appVersion,omitempty"`
	// Whether or not this chart is deprecated
	Deprecated bool `json:"deprecated,omitempty"`
	// Annotations are additional mappings uninterpreted by Helm,
	// made available for inspection by other applications.
	Annotations map[string]string `json:"annotations,omitempty"`
	// KubeVersion is a SemVer constraint specifying the version of Kubernetes required.
	KubeVersion string `json:"kubeVersion,omitempty"`
	// Specifies the chart type: application or library
	Type string `json:"type,omitempty"`
}

ChartMetadata for a Chart file. This models the structure of a Chart.yaml file.

type ChartVersion

type ChartVersion struct {
	Version    string    `json:"version"`
	AppVersion string    `json:"app_version"`
	Created    time.Time `json:"created"`
	Digest     string    `json:"digest"`
	URLs       []string  `json:"urls"`
	Readme     string    `json:"readme,omitempty"`
	Values     string    `json:"values,omitempty"`
	Schema     string    `json:"schema"`
}

ChartVersion is a representation of a specific version of a chart

type HelmHubChart

type HelmHubChart struct {
	APIResponse
	Attributes *ChartVersion `json:"attributes"`
}

type HelmHubChartResponse

type HelmHubChartResponse struct {
	Data HelmHubChart `json:"data"`
}

type IndexFile

type IndexFile struct {
	APIVersion string                         `json:"apiVersion,omitempty"`
	Entries    map[string][]IndexFileMetadata `json:"entries,omitempty"`
}

IndexFile represents the index.yaml structure for a Helm Repository

type IndexFileMetadata

type IndexFileMetadata struct {
	Name        string    `json:"name,omitempty"`
	AppVersion  string    `json:"appVersion" yaml:"appVersion"`
	Description string    `json:"description,omitempty"`
	Digest      string    `json:"digest,omitempty"`
	Version     string    `json:"version,omitempty"`
	Created     time.Time `json:"created"`
	Icon        string    `json:"icon,omitempty"`
	URLs        []string  `json:"-" yaml:"urls"`
	Sources     []string  `json:"-" yaml:"sources"`
	APIVersion  string    `json:"-" yaml:"apiVersion"`
}

IndexFileMetadata represents the metadata for a single chart version

type Meta

type Meta struct {
	TotalPages int `json:"totalPages"`
}

Meta the number of pages in the response

type Monocular

type Monocular struct {
	ChartStore      store.ChartStore
	FoundationDBURL string
	SyncServiceURL  string
	CacheFolder     string
	// contains filtered or unexported fields
}

Monocular is a plugin for Monocular

func (*Monocular) AddAdminGroupRoutes

func (m *Monocular) AddAdminGroupRoutes(echoGroup *echo.Group)

AddAdminGroupRoutes adds the admin routes for this plugin to the Echo server

func (*Monocular) AddSessionGroupRoutes

func (m *Monocular) AddSessionGroupRoutes(echoGroup *echo.Group)

AddSessionGroupRoutes adds the session routes for this plugin to the Echo server

func (*Monocular) Connect

func (m *Monocular) Connect(ec *echo.Context, cnsiRecord api.CNSIRecord, userId string) (*api.TokenRecord, bool, error)

Connect to the endpoint

func (*Monocular) Destroy

func (m *Monocular) Destroy()

Destroy does any cleanup for the plugin on exit

func (*Monocular) GetClientId

func (m *Monocular) GetClientId() string

GetClientId gets the default client ID to use

func (*Monocular) GetEndpointPlugin

func (m *Monocular) GetEndpointPlugin() (api.EndpointPlugin, error)

GetEndpointPlugin gets the endpoint plugin for this plugin

func (*Monocular) GetMiddlewarePlugin

func (m *Monocular) GetMiddlewarePlugin() (api.MiddlewarePlugin, error)

GetMiddlewarePlugin gets the middleware plugin for this plugin

func (*Monocular) GetRoutePlugin

func (m *Monocular) GetRoutePlugin() (api.RoutePlugin, error)

GetRoutePlugin gets the route plugin for this plugin

func (*Monocular) GetType

func (m *Monocular) GetType() string

GetType returns the endpoint type supported by this plugin

func (*Monocular) Info

func (m *Monocular) Info(apiEndpoint string, skipSSLValidation bool, caCert string) (api.CNSIRecord, interface{}, error)

Info checks the endpoint type and fetches any metadata

func (*Monocular) Init

func (m *Monocular) Init() error

Init performs plugin initialization

func (*Monocular) InitSync

func (m *Monocular) InitSync()

InitSync starts the go routine that will sync repositories in the background

func (*Monocular) OnEndpointNotification

func (m *Monocular) OnEndpointNotification(action api.EndpointAction, endpoint *api.CNSIRecord)

OnEndpointNotification handles notification that endpoint has been remoevd

func (*Monocular) Register

func (m *Monocular) Register(echoContext *echo.Context) error

Register will register a new endpoint of the type Helm

func (*Monocular) Sync

func (m *Monocular) Sync(action api.EndpointAction, endpoint *api.CNSIRecord)

Sync schedules a sync action for the given endpoint

func (*Monocular) UpdateMetadata

func (m *Monocular) UpdateMetadata(info *api.Info, userGUID string, echoContext *echo.Context)

UpdateMetadata not needed for Helm endpoints

func (*Monocular) Validate

func (m *Monocular) Validate(userGUID string, cnsiRecord api.CNSIRecord, tokenRecord api.TokenRecord) error

Validate validates the connection to the endpoint - verifies that we can actually connect and call its API

type Rel

type Rel struct {
	Data  interface{} `json:"data"`
	Links SelfLink    `json:"links"`
}

Rel describes a relationship between element(s) in a response

type RelMap

type RelMap map[string]Rel

RelMap maps elements e.g. Charts to other elements of a response e.g. Chart Versions

type Repo

type Repo struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

Repo holds the App repository details

type RepoCheck

type RepoCheck struct {
	ID         string    `bson:"_id"`
	LastUpdate time.Time `bson:"last_update"`
	Checksum   string    `bson:"checksum"`
}

RepoCheck describes the state of a repository in terms its current checksum and last update time. It is used to determine whether or not to re-sync a respository.

type SelfLink struct {
	Self string `json:"self"`
}

SelfLink the self-referencing URL to a chart in a response

type SyncJob

type SyncJob struct {
	Action   api.EndpointAction
	Endpoint *api.CNSIRecord
}

type SyncMetadata

type SyncMetadata struct {
	Status string `json:"status"`
	Busy   bool   `json:"busy"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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