document

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConverter

func NewConverter(frConverter FetchRequestConverter) *converter

func NewRepository

func NewRepository() *inMemoryRepository

func NewService

func NewService(repo DocumentRepository, uidService UIDService) *service

Types

type DocumentConverter

type DocumentConverter interface {
	ToGraphQL(in *model.Document) *graphql.Document
	InputFromGraphQL(in *graphql.DocumentInput) *model.DocumentInput
}

type DocumentRepository

type DocumentRepository interface {
	GetByID(id string) (*model.Document, error)
	ListByApplicationID(applicationID string, pageSize *int, cursor *string) (*model.DocumentPage, error)
	Create(item *model.Document) error
	Delete(item *model.Document) error
}

type DocumentService

type DocumentService interface {
	Create(ctx context.Context, applicationID string, in model.DocumentInput) (string, error)
	Get(ctx context.Context, id string) (*model.Document, error)
	Delete(ctx context.Context, id string) error
}

type FetchRequestConverter

type FetchRequestConverter interface {
	ToGraphQL(in *model.FetchRequest) *graphql.FetchRequest
	InputFromGraphQL(in *graphql.FetchRequestInput) *model.FetchRequestInput
}

type Resolver

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

func NewResolver

func NewResolver(svc DocumentService, frConverter FetchRequestConverter) *Resolver

func (*Resolver) AddDocument

func (r *Resolver) AddDocument(ctx context.Context, applicationID string, in graphql.DocumentInput) (*graphql.Document, error)

func (*Resolver) DeleteDocument

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

type UIDService

type UIDService interface {
	Generate() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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