Documentation ¶
Index ¶
- type Helper
- func (helper *Helper) CleanDB() error
- func (helper *Helper) ClearAllTables()
- func (helper *Helper) Count(table string) int64
- func (helper *Helper) CreateConsumer(name string) *api.Consumer
- func (helper *Helper) CreateConsumerList(count int) (consumers []*api.Consumer)
- func (helper *Helper) CreateConsumerWithLabels(name string, labels map[string]string) *api.Consumer
- func (helper *Helper) CreateJWTString(account *amv1.Account) string
- func (helper *Helper) CreateJWTToken(account *amv1.Account) *jwt.Token
- func (helper *Helper) CreateResource(consumerName string, replicas int) *api.Resource
- func (helper *Helper) CreateResourceList(consumerName string, count int) (resources []*api.Resource)
- func (helper *Helper) Delete(obj interface{})
- func (helper *Helper) DeleteAll(table interface{})
- func (helper *Helper) Env() *environments.Env
- func (helper *Helper) HealthCheckURL(path string) string
- func (helper *Helper) MetricsURL(path string) string
- func (helper *Helper) MigrateDB() error
- func (helper *Helper) MigrateDBTo(migrationID string)
- func (helper *Helper) NewAPIResource(consumerName string, replicas int) openapi.Resource
- func (helper *Helper) NewAccount(username, name, email string) *amv1.Account
- func (helper *Helper) NewApiClient() *openapi.APIClient
- func (helper *Helper) NewAuthenticatedContext(account *amv1.Account) context.Context
- func (helper *Helper) NewID() string
- func (helper *Helper) NewRandAccount() *amv1.Account
- func (helper *Helper) NewResource(consumerName string, replicas int) *api.Resource
- func (helper *Helper) NewUUID() string
- func (helper *Helper) OpenapiError(err error) openapi.Error
- func (helper *Helper) Reset()
- func (helper *Helper) ResetDB() error
- func (helper *Helper) RestURL(path string) string
- func (helper *Helper) RestartMetricsServer()
- func (helper *Helper) RestartServer()
- func (helper *Helper) SkipIfShort()
- func (helper *Helper) StartControllerManager(ctx context.Context)
- func (helper *Helper) StartGRPCResourceSourceClient()
- func (helper *Helper) StartJWKCertServerMock() (teardown func() error)
- func (helper *Helper) StartWorkAgent(ctx context.Context, clusterName string, mqttOptions *mqttoptions.MQTTOptions, ...)
- func (helper *Helper) Teardown()
- type MemoryStore
- func (s *MemoryStore) Add(resource *api.Resource)
- func (s *MemoryStore) Delete(resourceID string)
- func (s *MemoryStore) Get(resourceID string) (*api.Resource, error)
- func (s *MemoryStore) List(listOpts types.ListOptions) ([]*api.Resource, error)
- func (s *MemoryStore) ListByNamespace(namespace string) []*api.Resource
- func (s *MemoryStore) UpSert(resource *api.Resource)
- func (s *MemoryStore) Update(resource *api.Resource) error
- func (s *MemoryStore) UpdateStatus(resource *api.Resource) error
- type ResourceBundleCodec
- type ResourceCodec
- type TimeFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Helper ¶
type Helper struct { Ctx context.Context ContextCancelFunc context.CancelFunc EventBroadcaster *event.EventBroadcaster Store *MemoryStore GRPCSourceClient *generic.CloudEventSourceClient[*api.Resource] DBFactory db.SessionFactory AppConfig *config.ApplicationConfig APIServer server.Server MetricsServer server.Server HealthCheckServer server.Server PulseServer *server.PulseServer ControllerManager *server.ControllersServer WorkAgentHolder *work.ClientHolder TimeFunc TimeFunc JWTPrivateKey *rsa.PrivateKey JWTCA *rsa.PublicKey T *testing.T // contains filtered or unexported fields }
func RegisterIntegration ¶
Register a test This should be run before every integration test
func (*Helper) ClearAllTables ¶
func (helper *Helper) ClearAllTables()
func (*Helper) CreateConsumerList ¶
func (*Helper) CreateConsumerWithLabels ¶
func (*Helper) CreateJWTString ¶
func (*Helper) CreateJWTToken ¶
func (*Helper) CreateResource ¶
func (*Helper) CreateResourceList ¶
func (*Helper) Env ¶
func (helper *Helper) Env() *environments.Env
func (*Helper) HealthCheckURL ¶
func (*Helper) MetricsURL ¶
func (*Helper) MigrateDBTo ¶
func (*Helper) NewAPIResource ¶
func (*Helper) NewAccount ¶
func (*Helper) NewApiClient ¶
func (*Helper) NewAuthenticatedContext ¶
func (*Helper) NewRandAccount ¶
func (*Helper) NewResource ¶
func (*Helper) NewUUID ¶
NewUUID creates a new unique UUID, which has different formatting than ksuid UUID is used by telemeter and we validate the format.
func (*Helper) OpenapiError ¶
Convert an error response from the openapi client to an openapi error struct
func (*Helper) RestartMetricsServer ¶
func (helper *Helper) RestartMetricsServer()
func (*Helper) RestartServer ¶
func (helper *Helper) RestartServer()
func (*Helper) SkipIfShort ¶
func (helper *Helper) SkipIfShort()
func (*Helper) StartControllerManager ¶
func (*Helper) StartGRPCResourceSourceClient ¶
func (helper *Helper) StartGRPCResourceSourceClient()
func (*Helper) StartJWKCertServerMock ¶
func (*Helper) StartWorkAgent ¶
func (helper *Helper) StartWorkAgent(ctx context.Context, clusterName string, mqttOptions *mqttoptions.MQTTOptions, bundle bool)
type MemoryStore ¶
func NewStore ¶
func NewStore() *MemoryStore
func (*MemoryStore) Add ¶
func (s *MemoryStore) Add(resource *api.Resource)
func (*MemoryStore) Delete ¶
func (s *MemoryStore) Delete(resourceID string)
func (*MemoryStore) List ¶
func (s *MemoryStore) List(listOpts types.ListOptions) ([]*api.Resource, error)
func (*MemoryStore) ListByNamespace ¶
func (s *MemoryStore) ListByNamespace(namespace string) []*api.Resource
func (*MemoryStore) UpSert ¶
func (s *MemoryStore) UpSert(resource *api.Resource)
func (*MemoryStore) UpdateStatus ¶
func (s *MemoryStore) UpdateStatus(resource *api.Resource) error
type ResourceBundleCodec ¶
type ResourceBundleCodec struct{}
func (*ResourceBundleCodec) Decode ¶
func (c *ResourceBundleCodec) Decode(evt *cloudevents.Event) (*api.Resource, error)
func (*ResourceBundleCodec) Encode ¶
func (c *ResourceBundleCodec) Encode(source string, eventType types.CloudEventsType, resource *api.Resource) (*cloudevents.Event, error)
encode the kubernetes resource to a cloudevent format
func (*ResourceBundleCodec) EventDataType ¶
func (c *ResourceBundleCodec) EventDataType() types.CloudEventsDataType
type ResourceCodec ¶
type ResourceCodec struct{}
func (*ResourceCodec) Decode ¶
func (c *ResourceCodec) Decode(evt *cloudevents.Event) (*api.Resource, error)
func (*ResourceCodec) Encode ¶
func (c *ResourceCodec) Encode(source string, eventType types.CloudEventsType, resource *api.Resource) (*cloudevents.Event, error)
encode the kubernetes resource to a cloudevent format
func (*ResourceCodec) EventDataType ¶
func (c *ResourceCodec) EventDataType() types.CloudEventsDataType
Click to show internal directories.
Click to hide internal directories.