From 8fa0b258ac89781dae269790a4bde09cbcd2f324 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 29 Jul 2018 18:58:42 +0200 Subject: cleaning --- .../graphql-go/graphql/language/ast/values.go | 305 --------------------- 1 file changed, 305 deletions(-) delete mode 100644 vendor/github.com/graphql-go/graphql/language/ast/values.go (limited to 'vendor/github.com/graphql-go/graphql/language/ast/values.go') diff --git a/vendor/github.com/graphql-go/graphql/language/ast/values.go b/vendor/github.com/graphql-go/graphql/language/ast/values.go deleted file mode 100644 index 67912bdc..00000000 --- a/vendor/github.com/graphql-go/graphql/language/ast/values.go +++ /dev/null @@ -1,305 +0,0 @@ -package ast - -import ( - "github.com/graphql-go/graphql/language/kinds" -) - -type Value interface { - GetValue() interface{} - GetKind() string - GetLoc() *Location -} - -// Ensure that all value types implements Value interface -var _ Value = (*Variable)(nil) -var _ Value = (*IntValue)(nil) -var _ Value = (*FloatValue)(nil) -var _ Value = (*StringValue)(nil) -var _ Value = (*BooleanValue)(nil) -var _ Value = (*EnumValue)(nil) -var _ Value = (*ListValue)(nil) -var _ Value = (*ObjectValue)(nil) - -// Variable implements Node, Value -type Variable struct { - Kind string - Loc *Location - Name *Name -} - -func NewVariable(v *Variable) *Variable { - if v == nil { - v = &Variable{} - } - return &Variable{ - Kind: kinds.Variable, - Loc: v.Loc, - Name: v.Name, - } -} - -func (v *Variable) GetKind() string { - return v.Kind -} - -func (v *Variable) GetLoc() *Location { - return v.Loc -} - -// GetValue alias to Variable.GetName() -func (v *Variable) GetValue() interface{} { - return v.GetName() -} - -func (v *Variable) GetName() interface{} { - return v.Name -} - -// IntValue implements Node, Value -type IntValue struct { - Kind string - Loc *Location - Value string -} - -func NewIntValue(v *IntValue) *IntValue { - if v == nil { - v = &IntValue{} - } - return &IntValue{ - Kind: kinds.IntValue, - Loc: v.Loc, - Value: v.Value, - } -} - -func (v *IntValue) GetKind() string { - return v.Kind -} - -func (v *IntValue) GetLoc() *Location { - return v.Loc -} - -func (v *IntValue) GetValue() interface{} { - return v.Value -} - -// FloatValue implements Node, Value -type FloatValue struct { - Kind string - Loc *Location - Value string -} - -func NewFloatValue(v *FloatValue) *FloatValue { - if v == nil { - v = &FloatValue{} - } - return &FloatValue{ - Kind: kinds.FloatValue, - Loc: v.Loc, - Value: v.Value, - } -} - -func (v *FloatValue) GetKind() string { - return v.Kind -} - -func (v *FloatValue) GetLoc() *Location { - return v.Loc -} - -func (v *FloatValue) GetValue() interface{} { - return v.Value -} - -// StringValue implements Node, Value -type StringValue struct { - Kind string - Loc *Location - Value string -} - -func NewStringValue(v *StringValue) *StringValue { - if v == nil { - v = &StringValue{} - } - return &StringValue{ - Kind: kinds.StringValue, - Loc: v.Loc, - Value: v.Value, - } -} - -func (v *StringValue) GetKind() string { - return v.Kind -} - -func (v *StringValue) GetLoc() *Location { - return v.Loc -} - -func (v *StringValue) GetValue() interface{} { - return v.Value -} - -// BooleanValue implements Node, Value -type BooleanValue struct { - Kind string - Loc *Location - Value bool -} - -func NewBooleanValue(v *BooleanValue) *BooleanValue { - if v == nil { - v = &BooleanValue{} - } - return &BooleanValue{ - Kind: kinds.BooleanValue, - Loc: v.Loc, - Value: v.Value, - } -} - -func (v *BooleanValue) GetKind() string { - return v.Kind -} - -func (v *BooleanValue) GetLoc() *Location { - return v.Loc -} - -func (v *BooleanValue) GetValue() interface{} { - return v.Value -} - -// EnumValue implements Node, Value -type EnumValue struct { - Kind string - Loc *Location - Value string -} - -func NewEnumValue(v *EnumValue) *EnumValue { - if v == nil { - v = &EnumValue{} - } - return &EnumValue{ - Kind: kinds.EnumValue, - Loc: v.Loc, - Value: v.Value, - } -} - -func (v *EnumValue) GetKind() string { - return v.Kind -} - -func (v *EnumValue) GetLoc() *Location { - return v.Loc -} - -func (v *EnumValue) GetValue() interface{} { - return v.Value -} - -// ListValue implements Node, Value -type ListValue struct { - Kind string - Loc *Location - Values []Value -} - -func NewListValue(v *ListValue) *ListValue { - if v == nil { - v = &ListValue{} - } - return &ListValue{ - Kind: kinds.ListValue, - Loc: v.Loc, - Values: v.Values, - } -} - -func (v *ListValue) GetKind() string { - return v.Kind -} - -func (v *ListValue) GetLoc() *Location { - return v.Loc -} - -// GetValue alias to ListValue.GetValues() -func (v *ListValue) GetValue() interface{} { - return v.GetValues() -} - -func (v *ListValue) GetValues() interface{} { - // TODO: verify ObjectValue.GetValue() - return v.Values -} - -// ObjectValue implements Node, Value -type ObjectValue struct { - Kind string - Loc *Location - Fields []*ObjectField -} - -func NewObjectValue(v *ObjectValue) *ObjectValue { - if v == nil { - v = &ObjectValue{} - } - return &ObjectValue{ - Kind: kinds.ObjectValue, - Loc: v.Loc, - Fields: v.Fields, - } -} - -func (v *ObjectValue) GetKind() string { - return v.Kind -} - -func (v *ObjectValue) GetLoc() *Location { - return v.Loc -} - -func (v *ObjectValue) GetValue() interface{} { - // TODO: verify ObjectValue.GetValue() - return v.Fields -} - -// ObjectField implements Node, Value -type ObjectField struct { - Kind string - Name *Name - Loc *Location - Value Value -} - -func NewObjectField(f *ObjectField) *ObjectField { - if f == nil { - f = &ObjectField{} - } - return &ObjectField{ - Kind: kinds.ObjectField, - Loc: f.Loc, - Name: f.Name, - Value: f.Value, - } -} - -func (f *ObjectField) GetKind() string { - return f.Kind -} - -func (f *ObjectField) GetLoc() *Location { - return f.Loc -} - -func (f *ObjectField) GetValue() interface{} { - return f.Value -} -- cgit