application

package
v0.0.0-...-ecc6c17 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConverter

func NewConverter(webhook WebhookConverter, api APIConverter, eventAPI EventAPIConverter, document DocumentConverter) *converter

func NewRepository

func NewRepository() *inMemoryRepository

func NewService

func NewService(app ApplicationRepository, webhook WebhookRepository, api APIRepository, eventAPI EventAPIRepository, document DocumentRepository, uidService UIDService) *service

Types

type APIConverter

type APIConverter interface {
	ToGraphQL(in *model.APIDefinition) *graphql.APIDefinition
	MultipleToGraphQL(in []*model.APIDefinition) []*graphql.APIDefinition
	MultipleInputFromGraphQL(in []*graphql.APIDefinitionInput) []*model.APIDefinitionInput
	InputFromGraphQL(in *graphql.APIDefinitionInput) *model.APIDefinitionInput
}

type APIRepository

type APIRepository interface {
	ListByApplicationID(applicationID string, pageSize *int, cursor *string) (*model.APIDefinitionPage, error)
	CreateMany(items []*model.APIDefinition) error
	DeleteAllByApplicationID(id string) error
}

type APIService

type APIService interface {
	List(ctx context.Context, applicationID string, pageSize *int, cursor *string) (*model.APIDefinitionPage, error)
	Create(ctx context.Context, applicationID string, in model.APIDefinitionInput) (string, error)
	Update(ctx context.Context, id string, in model.APIDefinitionInput) error
	Delete(ctx context.Context, id string) error
}

type ApplicationConverter

type ApplicationConverter interface {
	ToGraphQL(in *model.Application) *graphql.Application
	MultipleToGraphQL(in []*model.Application) []*graphql.Application
	InputFromGraphQL(in graphql.ApplicationInput) model.ApplicationInput
}

type ApplicationRepository

type ApplicationRepository interface {
	GetByID(tenant, id string) (*model.Application, error)
	List(tenant string, filter []*labelfilter.LabelFilter, pageSize *int, cursor *string) (*model.ApplicationPage, error)
	Create(item *model.Application) error
	Update(item *model.Application) error
	Delete(item *model.Application) error
}

type ApplicationService

type ApplicationService interface {
	Create(ctx context.Context, in model.ApplicationInput) (string, error)
	Update(ctx context.Context, id string, in model.ApplicationInput) error
	Get(ctx context.Context, id string) (*model.Application, error)
	Delete(ctx context.Context, id string) error
	List(ctx context.Context, filter []*labelfilter.LabelFilter, pageSize *int, cursor *string) (*model.ApplicationPage, error)
	AddLabel(ctx context.Context, applicationID string, key string, values []string) error
	DeleteLabel(ctx context.Context, applicationID string, key string, values []string) error
	AddAnnotation(ctx context.Context, applicationID string, key string, value interface{}) error
	DeleteAnnotation(ctx context.Context, applicationID string, key string) error
}

type DocumentConverter

type DocumentConverter interface {
	MultipleToGraphQL(in []*model.Document) []*graphql.Document
	MultipleInputFromGraphQL(in []*graphql.DocumentInput) []*model.DocumentInput
}

type DocumentRepository

type DocumentRepository interface {
	ListAllByApplicationID(applicationID string) ([]*model.Document, error)
	CreateMany(items []*model.Document) error
	DeleteAllByApplicationID(id string) error
}

type DocumentService

type DocumentService interface {
	List(ctx context.Context, applicationID string, pageSize *int, cursor *string) (*model.DocumentPage, error)
}

type EventAPIConverter

type EventAPIConverter interface {
	ToGraphQL(in *model.EventAPIDefinition) *graphql.EventAPIDefinition
	MultipleToGraphQL(in []*model.EventAPIDefinition) []*graphql.EventAPIDefinition
	MultipleInputFromGraphQL(in []*graphql.EventAPIDefinitionInput) []*model.EventAPIDefinitionInput
	InputFromGraphQL(in *graphql.EventAPIDefinitionInput) *model.EventAPIDefinitionInput
}

type EventAPIRepository

type EventAPIRepository interface {
	ListByApplicationID(applicationID string, pageSize *int, cursor *string) (*model.EventAPIDefinitionPage, error)
	CreateMany(items []*model.EventAPIDefinition) error
	DeleteAllByApplicationID(id string) error
}

type EventAPIService

type EventAPIService interface {
	List(ctx context.Context, applicationID string, pageSize *int, cursor *string) (*model.EventAPIDefinitionPage, error)
	Create(ctx context.Context, applicationID string, in model.EventAPIDefinitionInput) (string, error)
	Update(ctx context.Context, id string, in model.EventAPIDefinitionInput) error
	Delete(ctx context.Context, id string) error
}

type Resolver

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

func NewResolver

func NewResolver(svc ApplicationService, apiSvc APIService, eventAPISvc EventAPIService, documentSvc DocumentService, webhookSvc WebhookService, appConverter ApplicationConverter, documentConverter DocumentConverter, webhookConverter WebhookConverter, apiConverter APIConverter, eventAPIConverter EventAPIConverter) *Resolver

func (*Resolver) AddApplicationAnnotation

func (r *Resolver) AddApplicationAnnotation(ctx context.Context, applicationID string, key string, value interface{}) (*graphql.Annotation, error)

func (*Resolver) AddApplicationLabel

func (r *Resolver) AddApplicationLabel(ctx context.Context, applicationID string, key string, values []string) (*graphql.Label, error)

func (*Resolver) AddApplicationWebhook

func (r *Resolver) AddApplicationWebhook(ctx context.Context, applicationID string, in graphql.ApplicationWebhookInput) (*graphql.ApplicationWebhook, error)

func (*Resolver) Apis

func (r *Resolver) Apis(ctx context.Context, obj *graphql.Application, group *string, first *int, after *graphql.PageCursor) (*graphql.APIDefinitionPage, error)

func (*Resolver) Application

func (r *Resolver) Application(ctx context.Context, id string) (*graphql.Application, error)

func (*Resolver) Applications

func (r *Resolver) Applications(ctx context.Context, filter []*graphql.LabelFilter, first *int, after *graphql.PageCursor) (*graphql.ApplicationPage, error)

func (*Resolver) CreateApplication

func (r *Resolver) CreateApplication(ctx context.Context, in graphql.ApplicationInput) (*graphql.Application, error)

func (*Resolver) DeleteApplication

func (r *Resolver) DeleteApplication(ctx context.Context, id string) (*graphql.Application, error)

func (*Resolver) DeleteApplicationAnnotation

func (r *Resolver) DeleteApplicationAnnotation(ctx context.Context, applicationID string, key string) (*graphql.Annotation, error)

func (*Resolver) DeleteApplicationLabel

func (r *Resolver) DeleteApplicationLabel(ctx context.Context, applicationID string, key string, values []string) (*graphql.Label, error)

func (*Resolver) DeleteApplicationWebhook

func (r *Resolver) DeleteApplicationWebhook(ctx context.Context, webhookID string) (*graphql.ApplicationWebhook, error)

func (*Resolver) Documents

func (r *Resolver) Documents(ctx context.Context, obj *graphql.Application, first *int, after *graphql.PageCursor) (*graphql.DocumentPage, error)

TODO: Proper error handling TODO: Pagination

func (*Resolver) EventAPIs

func (r *Resolver) EventAPIs(ctx context.Context, obj *graphql.Application, group *string, first *int, after *graphql.PageCursor) (*graphql.EventAPIDefinitionPage, error)

func (*Resolver) UpdateApplication

func (r *Resolver) UpdateApplication(ctx context.Context, id string, in graphql.ApplicationInput) (*graphql.Application, error)

func (*Resolver) UpdateApplicationWebhook

func (r *Resolver) UpdateApplicationWebhook(ctx context.Context, webhookID string, in graphql.ApplicationWebhookInput) (*graphql.ApplicationWebhook, error)

func (*Resolver) Webhooks

TODO: Proper error handling

type UIDService

type UIDService interface {
	Generate() string
}

type WebhookConverter

type WebhookConverter interface {
	ToGraphQL(in *model.ApplicationWebhook) *graphql.ApplicationWebhook
	MultipleToGraphQL(in []*model.ApplicationWebhook) []*graphql.ApplicationWebhook
	InputFromGraphQL(in *graphql.ApplicationWebhookInput) *model.ApplicationWebhookInput
	MultipleInputFromGraphQL(in []*graphql.ApplicationWebhookInput) []*model.ApplicationWebhookInput
}

type WebhookRepository

type WebhookRepository interface {
	ListByApplicationID(applicationID string) ([]*model.ApplicationWebhook, error)
	CreateMany(items []*model.ApplicationWebhook) error
	DeleteAllByApplicationID(id string) error
}

type WebhookService

type WebhookService interface {
	Get(ctx context.Context, id string) (*model.ApplicationWebhook, error)
	List(ctx context.Context, applicationID string) ([]*model.ApplicationWebhook, error)
	Create(ctx context.Context, applicationID string, in model.ApplicationWebhookInput) (string, error)
	Update(ctx context.Context, id string, in model.ApplicationWebhookInput) error
	Delete(ctx context.Context, id string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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