services

package
v0.0.0-...-d18f1db Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

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 ValidateConsumer(consumer *api.Consumer) error

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 ValidateObject(obj datatypes.JSONMap) error

func ValidateObjectUpdate

func ValidateObjectUpdate(new, old datatypes.JSONMap) error

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, 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, *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)
}

func NewResourceService

func NewResourceService(lockFactory db.LockFactory, resourceDao dao.ResourceDao, events EventService) ResourceService

Jump to

Keyboard shortcuts

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