webhook

package
v0.0.0-...-4d0b250 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConverter

func NewConverter(authConverter AuthConverter) *converter

NewConverter missing godoc

func NewRepository

func NewRepository(conv EntityConverter) *repository

NewRepository missing godoc

func NewService

func NewService(repo WebhookRepository, appRepo ApplicationRepository, uidSvc UIDService, tenantSvc TenantService, tenantMappingConfig map[string]interface{}, tenantMappingCallbackURL string) *service

NewService missing godoc

Types

type ApplicationRepository

type ApplicationRepository interface {
	GetGlobalByID(ctx context.Context, id string) (*model.Application, error)
}

ApplicationRepository missing godoc

type ApplicationService

type ApplicationService interface {
	Exist(ctx context.Context, id string) (bool, error)
}

ApplicationService missing godoc

type ApplicationTemplateService

type ApplicationTemplateService interface {
	Exists(ctx context.Context, id string) (bool, error)
}

ApplicationTemplateService missing godoc

type AuthConverter

type AuthConverter interface {
	ToGraphQL(in *model.Auth) (*graphql.Auth, error)
	InputFromGraphQL(in *graphql.AuthInput) (*model.AuthInput, error)
}

AuthConverter missing godoc

type Collection

type Collection []Entity

Collection is a collection of webhook entities.

func (Collection) Len

func (c Collection) Len() int

Len returns the number of entities in the collection.

type Entity

type Entity struct {
	ID                    string         `db:"id"`
	ApplicationID         sql.NullString `db:"app_id"`
	ApplicationTemplateID sql.NullString `db:"app_template_id"`
	RuntimeID             sql.NullString `db:"runtime_id"`
	IntegrationSystemID   sql.NullString `db:"integration_system_id"`
	FormationTemplateID   sql.NullString `db:"formation_template_id"`
	CollectionIDKey       sql.NullString `db:"correlation_id_key"`
	Type                  string         `db:"type"`
	Mode                  sql.NullString `db:"mode"`
	URL                   sql.NullString `db:"url"`
	ProxyURL              sql.NullString `db:"proxy_url"`
	Auth                  sql.NullString `db:"auth"`
	RetryInterval         sql.NullInt32  `db:"retry_interval"`
	Timeout               sql.NullInt32  `db:"timeout"`
	URLTemplate           sql.NullString `db:"url_template"`
	InputTemplate         sql.NullString `db:"input_template"`
	HeaderTemplate        sql.NullString `db:"header_template"`
	OutputTemplate        sql.NullString `db:"output_template"`
	StatusTemplate        sql.NullString `db:"status_template"`
	CreatedAt             *time.Time     `db:"created_at"`
}

Entity is a webhook entity.

func (*Entity) DecorateWithTenantID

func (e *Entity) DecorateWithTenantID(tenant string) interface{}

DecorateWithTenantID decorates the entity with the given tenant ID.

func (*Entity) GetID

func (e *Entity) GetID() string

GetID returns the ID of the entity.

func (*Entity) GetParent

func (e *Entity) GetParent(_ resource.Type) (resource.Type, string)

GetParent returns the parent type and the parent ID of the entity.

type EntityConverter

type EntityConverter interface {
	FromEntity(in *Entity) (*model.Webhook, error)
	ToEntity(in *model.Webhook) (*Entity, error)
}

EntityConverter missing godoc

type OwningResource

type OwningResource string

OwningResource missing godoc

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver missing godoc

func NewResolver

func NewResolver(transact persistence.Transactioner, webhookSvc WebhookService, applicationService ApplicationService, appTemplateService ApplicationTemplateService, runtimeService runtimeService, formationTemplateService formationTemplateService, webhookConverter WebhookConverter) *Resolver

NewResolver missing godoc

func (*Resolver) AddWebhook

func (r *Resolver) AddWebhook(ctx context.Context, applicationID *string, applicationTemplateID *string, runtimeID *string, formationTemplateID *string, in graphql.WebhookInput) (*graphql.Webhook, error)

AddWebhook missing godoc

func (*Resolver) DeleteWebhook

func (r *Resolver) DeleteWebhook(ctx context.Context, webhookID string) (*graphql.Webhook, error)

DeleteWebhook missing godoc

func (*Resolver) UpdateWebhook

func (r *Resolver) UpdateWebhook(ctx context.Context, webhookID string, in graphql.WebhookInput) (*graphql.Webhook, error)

UpdateWebhook missing godoc

type TenantService

type TenantService interface {
	ExtractTenantIDForTenantScopedFormationTemplates(ctx context.Context) (string, error)
}

TenantService is responsible for service-layer tenant operations

type UIDService

type UIDService interface {
	Generate() string
}

UIDService missing godoc

type WebhookConverter

type WebhookConverter interface {
	ToGraphQL(in *model.Webhook) (*graphql.Webhook, error)
	MultipleToGraphQL(in []*model.Webhook) ([]*graphql.Webhook, error)
	InputFromGraphQL(in *graphql.WebhookInput) (*model.WebhookInput, error)
	MultipleInputFromGraphQL(in []*graphql.WebhookInput) ([]*model.WebhookInput, error)
}

WebhookConverter missing godoc

type WebhookRepository

type WebhookRepository interface {
	GetByID(ctx context.Context, tenant, id string, objectType model.WebhookReferenceObjectType) (*model.Webhook, error)
	GetByIDGlobal(ctx context.Context, id string) (*model.Webhook, error)
	GetByIDAndWebhookTypeGlobal(ctx context.Context, objectID string, objectType model.WebhookReferenceObjectType, webhookType model.WebhookType) (*model.Webhook, error)
	ListByReferenceObjectID(ctx context.Context, tenant, objID string, objType model.WebhookReferenceObjectType) ([]*model.Webhook, error)
	ListByReferenceObjectIDGlobal(ctx context.Context, objID string, objType model.WebhookReferenceObjectType) ([]*model.Webhook, error)
	ListByWebhookType(ctx context.Context, webhookType model.WebhookType) ([]*model.Webhook, error)
	ListByTypeAndLabelFilter(ctx context.Context, webhookType model.WebhookType, filter []*labelfilter.LabelFilter) ([]*model.Webhook, error)
	ListByApplicationTemplateID(ctx context.Context, applicationTemplateID string) ([]*model.Webhook, error)
	Create(ctx context.Context, tenant string, item *model.Webhook) error
	Update(ctx context.Context, tenant string, item *model.Webhook) error
	Delete(ctx context.Context, id string) error
}

WebhookRepository missing godoc

type WebhookService

type WebhookService interface {
	Get(ctx context.Context, id string, objectType model.WebhookReferenceObjectType) (*model.Webhook, error)
	GetByIDAndWebhookTypeGlobal(ctx context.Context, objectID string, objectType model.WebhookReferenceObjectType, webhookType model.WebhookType) (*model.Webhook, error)
	ListAllApplicationWebhooks(ctx context.Context, applicationID string) ([]*model.Webhook, error)
	ListForRuntime(ctx context.Context, runtimeID string) ([]*model.Webhook, error)
	ListForApplication(ctx context.Context, applicationID string) ([]*model.Webhook, error)
	ListForApplicationGlobal(ctx context.Context, applicationID string) ([]*model.Webhook, error)
	ListForApplicationTemplate(ctx context.Context, applicationTemplateID string) ([]*model.Webhook, error)
	ListByWebhookType(ctx context.Context, webhookType model.WebhookType) ([]*model.Webhook, error)
	EnrichWebhooksWithTenantMappingWebhooks(in []*graphql.WebhookInput) ([]*graphql.WebhookInput, error)
	Create(ctx context.Context, resourceID string, in model.WebhookInput, objectType model.WebhookReferenceObjectType) (string, error)
	Update(ctx context.Context, id string, in model.WebhookInput, objectType model.WebhookReferenceObjectType) error
	Delete(ctx context.Context, id string, objectType model.WebhookReferenceObjectType) error
}

WebhookService missing godoc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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