Documentation
¶
Index ¶
- func NewConverter(webhook WebhookConverter, api APIConverter, eventAPI EventAPIConverter, ...) *converter
- func NewRepository() *inMemoryRepository
- func NewService(app ApplicationRepository, webhook WebhookRepository, api APIRepository, ...) *service
- type APIConverter
- type APIRepository
- type APIService
- type ApplicationConverter
- type ApplicationRepository
- type ApplicationService
- type DocumentConverter
- type DocumentRepository
- type DocumentService
- type EventAPIConverter
- type EventAPIRepository
- type EventAPIService
- type Resolver
- func (r *Resolver) AddApplicationAnnotation(ctx context.Context, applicationID string, key string, value interface{}) (*graphql.Annotation, error)
- func (r *Resolver) AddApplicationLabel(ctx context.Context, applicationID string, key string, values []string) (*graphql.Label, error)
- func (r *Resolver) AddApplicationWebhook(ctx context.Context, applicationID string, in graphql.ApplicationWebhookInput) (*graphql.ApplicationWebhook, error)
- func (r *Resolver) Apis(ctx context.Context, obj *graphql.Application, group *string, first *int, ...) (*graphql.APIDefinitionPage, error)
- func (r *Resolver) Application(ctx context.Context, id string) (*graphql.Application, error)
- func (r *Resolver) Applications(ctx context.Context, filter []*graphql.LabelFilter, first *int, ...) (*graphql.ApplicationPage, error)
- func (r *Resolver) CreateApplication(ctx context.Context, in graphql.ApplicationInput) (*graphql.Application, error)
- func (r *Resolver) DeleteApplication(ctx context.Context, id string) (*graphql.Application, error)
- func (r *Resolver) DeleteApplicationAnnotation(ctx context.Context, applicationID string, key string) (*graphql.Annotation, error)
- func (r *Resolver) DeleteApplicationLabel(ctx context.Context, applicationID string, key string, values []string) (*graphql.Label, error)
- func (r *Resolver) DeleteApplicationWebhook(ctx context.Context, webhookID string) (*graphql.ApplicationWebhook, error)
- func (r *Resolver) Documents(ctx context.Context, obj *graphql.Application, first *int, ...) (*graphql.DocumentPage, error)
- func (r *Resolver) EventAPIs(ctx context.Context, obj *graphql.Application, group *string, first *int, ...) (*graphql.EventAPIDefinitionPage, error)
- func (r *Resolver) UpdateApplication(ctx context.Context, id string, in graphql.ApplicationInput) (*graphql.Application, error)
- func (r *Resolver) UpdateApplicationWebhook(ctx context.Context, webhookID string, in graphql.ApplicationWebhookInput) (*graphql.ApplicationWebhook, error)
- func (r *Resolver) Webhooks(ctx context.Context, obj *graphql.Application) ([]*graphql.ApplicationWebhook, error)
- type UIDService
- type WebhookConverter
- type WebhookRepository
- type WebhookService
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 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 DocumentService ¶
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 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 (*Resolver) AddApplicationLabel ¶
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 (*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 (*Resolver) DeleteApplicationAnnotation ¶
func (*Resolver) DeleteApplicationLabel ¶
func (*Resolver) DeleteApplicationWebhook ¶
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 ¶
func (r *Resolver) Webhooks(ctx context.Context, obj *graphql.Application) ([]*graphql.ApplicationWebhook, error)
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 }
Click to show internal directories.
Click to hide internal directories.