adapter

package
v0.0.0-...-887dc56 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Copyright © 2020 weapons97@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	NULL_POINT_ERROR = fmt.Errorf(`null pointer`)
)

Functions

func LoadWithRawValues

func LoadWithRawValues(cp string) (c *chart.Chart, e error)

func MergeValues

func MergeValues(v1, v2 []byte) (v3 []byte, e3 error)

MergeValues 合并yaml 值, 如果同一key上值冲突会用v2 覆盖v1 的值

func ToStruct

func ToStruct(msg interface{}) (pbs *pstruct.Struct, e error)

ToStruct marshal interface to pstruct.Struct

Types

type Adapter

type Adapter interface {
	InstallCharts(releaseName, repoName, version string, userValues []byte, dryRun bool) (*Release, error)
	UpgradeRelease(releaseName, repoName, version string, userValues []byte,
		dryRun bool, maxhistory int, resetValue bool) (*Release, error)
	UninstallRelease(relName string) error
	GetChartDetail(chartPath, version string) (*Chart, error)

	GetRelease(release string) (*Release, error)
	GetValues(relName string) (string, map[string]interface{}, error)
	ListRelease() ([]*Release, error)

	RollbackRelease(releaseName string, ver int) error
	GetHistory(name string) ([]*Release, error)
	Search(keyword string, regexp bool) (charts []*ChartInfo, e error)
	All() (charts []*ChartInfo, e error)
}

func NewAdapter

func NewAdapter(cfg *action.Configuration,
	setting *cli.EnvSettings,
	namespace string,
) Adapter

type Chart

type Chart chart.Chart

func (*Chart) Convert

func (c *Chart) Convert() (res *protos.Chart, e error)

Convert to protos for Chart

type ChartInfo

type ChartInfo struct {
	Name         string `json:"name"`
	RepoName     string `json:"repo_name"`
	ChartVersion string `json:"chart_version"`
	AppVersion   string `json:"app_version"`
	Icon         string `json:"icon"`
	Description  string `json:"description"`
}

func (*ChartInfo) Convert

func (ci *ChartInfo) Convert() *protos.ChartInfo

type Dependency

type Dependency chart.Dependency

func (*Dependency) Convert

func (d *Dependency) Convert() (res *protos.Dependency, e error)

Convert to protos for Dependency

type Entry

type Entry repo.Entry

func ConvertEntry

func ConvertEntry(en *protos.Entry) Entry

ConvertEntry convert protos.Entry to adpter Entry

type File

type File chart.File

func (*File) Convert

func (f *File) Convert() (res *protos.File, e error)

Convert to protos for File

type Hook

type Hook release.Hook

func (*Hook) Convert

func (h *Hook) Convert() (res *protos.Hook, e error)

Convert to protos for Hook

type Maintainer

type Maintainer chart.Maintainer

func (*Maintainer) Convert

func (mt *Maintainer) Convert() (res *protos.Maintainer, e error)

type Metadata

type Metadata chart.Metadata

func (*Metadata) Convert

func (md *Metadata) Convert() (res *protos.Metadata, e error)

Convert to protos for Chart

type Release

type Release release.Release

func (*Release) Convert

func (rel *Release) Convert() (res *protos.Release, e error)

Convert to protos for Release

Jump to

Keyboard shortcuts

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