Documentation ¶
Index ¶
- Variables
- func ClearAllData()
- func FlushCache()
- func Get(fun func(dirMapping *DevDirMapping, pathToPack map[DevPath][]*SvcPack) error) error
- func Initial()
- func Update(fun func(dirMapping *DevDirMapping, pathToPack map[DevPath][]*SvcPack) error) error
- type AllSvcPackAssociateByPath
- type DevDirMapping
- type DevPath
- func (d DevPath) AlreadyAssociate(specifyPack *SvcPack) bool
- func (d DevPath) Associate(specifyPack *SvcPack, kubeconfig string, setAsDefaultSvc bool) error
- func (d DevPath) GetAllPacks() *AllSvcPackAssociateByPath
- func (d DevPath) GetDefaultPack() (*SvcPack, error)
- func (d DevPath) RemovePack(specifyPack *SvcPack) error
- func (d DevPath) ToString() string
- type SvcPack
- func (svcPack *SvcPack) GetAssociatePath() DevPath
- func (svcPack *SvcPack) GetAssociatePathCache() DevPath
- func (svcPack *SvcPack) GetKubeConfigBytesAndServer() (string, string)
- func (svcPack SvcPack) Key() SvcPackKey
- func (svcPack SvcPack) KeyWithoutContainer() SvcPackKey
- func (svcPack *SvcPack) UnAssociatePath()
- type SvcPackKey
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultKey = "DefaultKey"
)
View Source
var (
NO_DEFAULT_PACK = errors.New("Current Svc pack not found ")
)
Functions ¶
func FlushCache ¶
func FlushCache()
Types ¶
type AllSvcPackAssociateByPath ¶
type AllSvcPackAssociateByPath struct { Packs map[SvcPackKey]*SvcPack Kubeconfigs map[SvcPackKey]string ServerMapping map[SvcPackKey]string DefaultSvcPackKey SvcPackKey }
type DevDirMapping ¶
type DevDirMapping struct { PathToDefaultPackKey map[DevPath]SvcPackKey `yaml:"path_to_default_pack_key"` PackToPath map[SvcPackKey]DevPath `yaml:"pack_to_path"` PackToKubeConfigBytes map[SvcPackKey]string `yaml:"pack_to_kube_config_bytes"` PackToKubeConfigServer map[SvcPackKey]string `yaml:"pack_to_kube_config_server"` }
type DevPath ¶
type DevPath string
func (DevPath) AlreadyAssociate ¶
func (DevPath) Associate ¶
Associate setAsDefaultSvc: if this dev path has been associate by svc && [setAsDefaultSvc==true] replace the default svc to the path
setAsDefaultSvc==false when data migration
func (DevPath) GetAllPacks ¶
func (d DevPath) GetAllPacks() *AllSvcPackAssociateByPath
func (DevPath) GetDefaultPack ¶
return error if not found
func (DevPath) RemovePack ¶
type SvcPack ¶
type SvcPack struct { Ns string `yaml:"ns" json:"ns"` Nid string `yaml:"nid" json:"nid"` App string `yaml:"app" json:"app"` SvcType base.SvcType `yaml:"svc_type" json:"svc_type"` Svc string `yaml:"svc" json:"svc"` Container string `yaml:"container" json:"container"` }
func NewSvcPack ¶
func (*SvcPack) GetAssociatePath ¶
get associate path of svcPack if no path match, try with svc with none container
func (*SvcPack) GetAssociatePathCache ¶
func (*SvcPack) GetKubeConfigBytesAndServer ¶
return "" if error occur
func (SvcPack) Key ¶
func (svcPack SvcPack) Key() SvcPackKey
func (SvcPack) KeyWithoutContainer ¶
func (svcPack SvcPack) KeyWithoutContainer() SvcPackKey
func (*SvcPack) UnAssociatePath ¶
func (svcPack *SvcPack) UnAssociatePath()
type SvcPackKey ¶
type SvcPackKey string
func (SvcPackKey) WithoutNid ¶
func (svcPackKey SvcPackKey) WithoutNid() SvcPackKey
Click to show internal directories.
Click to hide internal directories.