Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterResourceMetrics()
- func ResetResourceMetrics()
- func UnregisterResourceMetrics()
- func ValidateConsumer(consumer *api.Consumer) error
- func ValidateManifest(resType api.ResourceType, manifest datatypes.JSONMap) error
- func ValidateManifestUpdate(resType api.ResourceType, new, old datatypes.JSONMap) error
- func ValidateObject(obj datatypes.JSONMap) error
- func ValidateObjectUpdate(new, old datatypes.JSONMap) error
- func ValidateResourceName(resource *api.Resource) error
- type ConsumerService
- type EventService
- type GenericService
- type ListArguments
- type ResourceService
- type StatusEventService
Constants ¶
View Source
const MAX_LIST_SIZE = 65500
~65500 is the maximum number of parameters that can be provided to a postgres WHERE IN clause Use it as a sane max
Variables ¶
View Source
var (
SearchDisallowedFields = map[string]map[string]string{}
)
Functions ¶
func ValidateConsumer ¶
func ValidateManifest ¶
func ValidateManifest(resType api.ResourceType, manifest datatypes.JSONMap) error
func ValidateManifestUpdate ¶
func ValidateManifestUpdate(resType api.ResourceType, new, old datatypes.JSONMap) error
func ValidateObject ¶
func ValidateObjectUpdate ¶
func ValidateResourceName ¶
Types ¶
type ConsumerService ¶
type ConsumerService interface { Get(ctx context.Context, id string) (*api.Consumer, *errors.ServiceError) Create(ctx context.Context, consumer *api.Consumer) (*api.Consumer, *errors.ServiceError) Replace(ctx context.Context, consumer *api.Consumer) (*api.Consumer, *errors.ServiceError) Delete(ctx context.Context, id string) *errors.ServiceError All(ctx context.Context) (api.ConsumerList, *errors.ServiceError) FindByIDs(ctx context.Context, ids []string) (api.ConsumerList, *errors.ServiceError) }
func NewConsumerService ¶
func NewConsumerService(lockFactory db.LockFactory, consumerDao dao.ConsumerDao, resourceDao dao.ResourceDao, events EventService) ConsumerService
type EventService ¶
type EventService interface { Get(ctx context.Context, id string) (*api.Event, *errors.ServiceError) Create(ctx context.Context, event *api.Event) (*api.Event, *errors.ServiceError) Replace(ctx context.Context, event *api.Event) (*api.Event, *errors.ServiceError) Delete(ctx context.Context, id string) *errors.ServiceError All(ctx context.Context) (api.EventList, *errors.ServiceError) FindByIDs(ctx context.Context, ids []string) (api.EventList, *errors.ServiceError) FindAllUnreconciledEvents(ctx context.Context) (api.EventList, *errors.ServiceError) DeleteAllReconciledEvents(ctx context.Context) *errors.ServiceError }
func NewEventService ¶
func NewEventService(eventDao dao.EventDao) EventService
type GenericService ¶
type GenericService interface {
List(ctx context.Context, username string, args *ListArguments, resourceList interface{}) (*api.PagingMeta, *errors.ServiceError)
}
func NewGenericService ¶
func NewGenericService(genericDao dao.GenericDao) GenericService
type ListArguments ¶
type ListArguments struct { Page int Size int64 Preloads []string Search string OrderBy []string Fields []string }
ListArguments are arguments relevant for listing objects. This struct is common to all service List funcs in this package
func NewListArguments ¶
func NewListArguments(params url.Values) *ListArguments
Create ListArguments from url query parameters with sane defaults
type ResourceService ¶
type ResourceService interface { Get(ctx context.Context, id string) (*api.Resource, *errors.ServiceError) Create(ctx context.Context, resource *api.Resource) (*api.Resource, *errors.ServiceError) Update(ctx context.Context, resource *api.Resource) (*api.Resource, *errors.ServiceError) UpdateStatus(ctx context.Context, resource *api.Resource) (*api.Resource, bool, *errors.ServiceError) MarkAsDeleting(ctx context.Context, id string) *errors.ServiceError Delete(ctx context.Context, id string) *errors.ServiceError All(ctx context.Context) (api.ResourceList, *errors.ServiceError) FindByIDs(ctx context.Context, ids []string) (api.ResourceList, *errors.ServiceError) FindBySource(ctx context.Context, source string) (api.ResourceList, *errors.ServiceError) List(listOpts cetypes.ListOptions) ([]*api.Resource, error) ListWithArgs(ctx context.Context, username string, args *ListArguments, resources *[]api.Resource) (*api.PagingMeta, *errors.ServiceError) }
func NewResourceService ¶
func NewResourceService(lockFactory db.LockFactory, resourceDao dao.ResourceDao, events EventService, generic GenericService) ResourceService
type StatusEventService ¶
type StatusEventService interface { Get(ctx context.Context, id string) (*api.StatusEvent, *errors.ServiceError) Create(ctx context.Context, event *api.StatusEvent) (*api.StatusEvent, *errors.ServiceError) Replace(ctx context.Context, event *api.StatusEvent) (*api.StatusEvent, *errors.ServiceError) Delete(ctx context.Context, id string) *errors.ServiceError All(ctx context.Context) (api.StatusEventList, *errors.ServiceError) FindByIDs(ctx context.Context, ids []string) (api.StatusEventList, *errors.ServiceError) FindAllUnreconciledEvents(ctx context.Context) (api.StatusEventList, *errors.ServiceError) DeleteAllReconciledEvents(ctx context.Context) *errors.ServiceError DeleteAllEvents(ctx context.Context, eventIDs []string) *errors.ServiceError }
func NewStatusEventService ¶
func NewStatusEventService(statusEventDao dao.StatusEventDao) StatusEventService
Click to show internal directories.
Click to hide internal directories.