Documentation ¶
Index ¶
- Constants
- Variables
- func FromSyncContext(ctx context.Context) (*nautescfg.Config, map[string]string, []client.ListOption, error)
- func GetProvider(ctx context.Context, key nautesctx.ContextKey, k8sClient client.Client) (baseinterface.ProductProvider, error)
- func NewSyncContext(ctx context.Context, cfg nautescfg.Config, label map[string]string, ...) context.Context
- type MockProductProvider
- type MockProductProviderFactory
- type ProductProviderSyncer
- type ProviderFacotry
Constants ¶
View Source
const ( ContextKeyLabel nautesctx.ContextKey = "productprovider.syncer.label" ContextKeyConfig nautesctx.ContextKey = "productprovider.syncer.config" ContextKeyListOptions nautesctx.ContextKey = "productprovider.syncer.listopts" )
Variables ¶
View Source
var ProductProviders = map[string]ProviderFacotry{}
Functions ¶
func FromSyncContext ¶
func GetProvider ¶
func GetProvider(ctx context.Context, key nautesctx.ContextKey, k8sClient client.Client) (baseinterface.ProductProvider, error)
Types ¶
type MockProductProvider ¶
type MockProductProvider struct { ProductList []nautescrd.Product ProductMeta baseinterface.ProductMeta Provider baseinterface.CodeRepoProvider }
var MockProvider *MockProductProvider
func (*MockProductProvider) GetCodeRepoProvider ¶
func (p *MockProductProvider) GetCodeRepoProvider(ctx context.Context) (baseinterface.CodeRepoProvider, error)
func (*MockProductProvider) GetProductMeta ¶
func (p *MockProductProvider) GetProductMeta(ctx context.Context, ID string) (baseinterface.ProductMeta, error)
func (*MockProductProvider) GetProducts ¶
func (p *MockProductProvider) GetProducts() ([]nautescrd.Product, error)
type MockProductProviderFactory ¶
type MockProductProviderFactory struct{}
func (*MockProductProviderFactory) GetProvider ¶
func (p *MockProductProviderFactory) GetProvider(ctx context.Context, name string, k8s client.Client, cfg nautescfg.Config) (baseinterface.ProductProvider, error)
type ProductProviderSyncer ¶
type ProductProviderSyncer struct { NautesConfig nautescfg.NautesConfigs Rest *rest.Config // contains filtered or unexported fields }
func (*ProductProviderSyncer) Setup ¶
func (s *ProductProviderSyncer) Setup() error
func (*ProductProviderSyncer) Sync ¶
func (s *ProductProviderSyncer) Sync(ctx context.Context, productProvider nautescrd.ProductProvider) error
type ProviderFacotry ¶
type ProviderFacotry interface {
GetProvider(ctx context.Context, name string, k8s client.Client, cfg nautescfg.Config) (baseinterface.ProductProvider, error)
}
Click to show internal directories.
Click to hide internal directories.