Documentation ¶
Index ¶
- func NewAPIRepository() *inMemoryRepository
- func NewConverter(auth AuthConverter, fr FetchRequestConverter, version VersionConverter) *converter
- func NewService(repo APIRepository, uidService UIDService) *service
- type APIConverter
- type APIRepository
- type APIService
- type AuthConverter
- type FetchRequestConverter
- type Resolver
- func (r *Resolver) AddAPI(ctx context.Context, applicationID string, in graphql.APIDefinitionInput) (*graphql.APIDefinition, error)
- func (r *Resolver) DeleteAPI(ctx context.Context, id string) (*graphql.APIDefinition, error)
- func (r *Resolver) DeleteAPIAuth(ctx context.Context, apiID string, runtimeID string) (*graphql.RuntimeAuth, error)
- func (r *Resolver) RefetchAPISpec(ctx context.Context, apiID string) (*graphql.APISpec, error)
- func (r *Resolver) SetAPIAuth(ctx context.Context, apiID string, runtimeID string, in graphql.AuthInput) (*graphql.RuntimeAuth, error)
- func (r *Resolver) UpdateAPI(ctx context.Context, id string, in graphql.APIDefinitionInput) (*graphql.APIDefinition, error)
- type UIDService
- type VersionConverter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAPIRepository ¶
func NewAPIRepository() *inMemoryRepository
func NewConverter ¶
func NewConverter(auth AuthConverter, fr FetchRequestConverter, version VersionConverter) *converter
func NewService ¶
func NewService(repo APIRepository, 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 { GetByID(id string) (*model.APIDefinition, error) ListByApplicationID(applicationID string, pageSize *int, cursor *string) (*model.APIDefinitionPage, error) CreateMany(item []*model.APIDefinition) error List(filter []*labelfilter.LabelFilter, pageSize *int, cursor *string) (*model.APIDefinitionPage, error) Create(item *model.APIDefinition) error Update(item *model.APIDefinition) error Delete(item *model.APIDefinition) error DeleteAllByApplicationID(id string) error }
type APIService ¶
type APIService interface { Create(ctx context.Context, applicationID string, in model.APIDefinitionInput) (string, error) Update(ctx context.Context, id string, in model.APIDefinitionInput) error Get(ctx context.Context, id string) (*model.APIDefinition, error) Delete(ctx context.Context, id string) error SetAPIAuth(ctx context.Context, apiID string, runtimeID string, in model.AuthInput) (*model.RuntimeAuth, error) DeleteAPIAuth(ctx context.Context, apiID string, runtimeID string) (*model.RuntimeAuth, error) RefetchAPISpec(ctx context.Context, id string) (*model.APISpec, error) }
type AuthConverter ¶
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 APIService, converter APIConverter, authConverter AuthConverter) *Resolver
func (*Resolver) AddAPI ¶
func (r *Resolver) AddAPI(ctx context.Context, applicationID string, in graphql.APIDefinitionInput) (*graphql.APIDefinition, error)
func (*Resolver) DeleteAPIAuth ¶
func (*Resolver) RefetchAPISpec ¶
func (*Resolver) SetAPIAuth ¶
type UIDService ¶
type UIDService interface {
Generate() string
}
type VersionConverter ¶
type VersionConverter interface { ToGraphQL(in *model.Version) *graphql.Version InputFromGraphQL(in *graphql.VersionInput) *model.VersionInput }
Click to show internal directories.
Click to hide internal directories.