merger

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtendMergerFunc

type ExtendMergerFunc func(schemas []*MergeInput) (*MergeResult, error)

func (ExtendMergerFunc) Merge

func (em ExtendMergerFunc) Merge(inputs []*MergeInput) (*MergeResult, error)

type MergeInput

type MergeInput struct {
	Schema *ast.Schema
	URL    string
}

type MergeResult

type MergeResult struct {
	Schema     *ast.Schema
	TypeURLMap TypeURLMap
}

type Merger

type Merger interface {
	Merge([]*MergeInput) (*MergeResult, error)
}

Merger is an interface for structs that are capable of taking a list of schemas and returning something that resembles a "merge" of those schemas.

type SanitizeNodeMergerFunc added in v0.1.16

type SanitizeNodeMergerFunc func(schemas []*MergeInput) (*MergeResult, error)

func (SanitizeNodeMergerFunc) Merge added in v0.1.16

func (SanitizeNodeMergerFunc) Merge(inputs []*MergeInput) (*MergeResult, error)

type TypeProps

type TypeProps struct {
	// Fields is map[filedname]url
	Fields map[string]string
	// True if type implements node
	IsImplementsNode bool
}

type TypeURLMap

type TypeURLMap map[string]*TypeProps

TypeURLMap represents typename:fieldname:url mapping

func (TypeURLMap) Get

func (t TypeURLMap) Get(typename, fieldname string) (res string, ok bool)

func (TypeURLMap) GetForType added in v0.1.12

func (t TypeURLMap) GetForType(typename string) (res []string, ok bool)

func (TypeURLMap) GetTypeIsImplementsNode

func (t TypeURLMap) GetTypeIsImplementsNode(typename string) (res bool, ok bool)

func (TypeURLMap) GetURLs

func (t TypeURLMap) GetURLs() []string

func (TypeURLMap) Set

func (t TypeURLMap) Set(typename, fieldname, url string)

func (TypeURLMap) SetFromSchema

func (t TypeURLMap) SetFromSchema(schema map[string]*ast.Definition, url string)

func (TypeURLMap) SetTypeIsImplementsNode

func (t TypeURLMap) SetTypeIsImplementsNode(typename string)

Jump to

Keyboard shortcuts

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