Skip to content

Commit

Permalink
Adding further Go documentation (#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
bendbennett committed Nov 14, 2022
1 parent 23bfa1a commit 59d7778
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions types/bool.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (
type BoolValuable interface {
attr.Value

// ToBoolValue should convert the value type to a Bool.
ToBoolValue(ctx context.Context) (Bool, diag.Diagnostics)
}

Expand Down
1 change: 1 addition & 0 deletions types/float64.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var (
type Float64Valuable interface {
attr.Value

// ToFloat64Value should convert the value type to a Float64.
ToFloat64Value(ctx context.Context) (Float64, diag.Diagnostics)
}

Expand Down
1 change: 1 addition & 0 deletions types/int64.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var (
type Int64Valuable interface {
attr.Value

// ToInt64Value should convert the value type to an Int64.
ToInt64Value(ctx context.Context) (Int64, diag.Diagnostics)
}

Expand Down
2 changes: 2 additions & 0 deletions types/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var (
type ListTypable interface {
attr.Type

// ValueFromList should convert the List to a ListValuable type.
ValueFromList(context.Context, List) (ListValuable, diag.Diagnostics)
}

Expand All @@ -32,6 +33,7 @@ type ListTypable interface {
type ListValuable interface {
attr.Value

// ToListValue should convert the value type to a List.
ToListValue(ctx context.Context) (List, diag.Diagnostics)
}

Expand Down
2 changes: 2 additions & 0 deletions types/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var (
type MapTypable interface {
attr.Type

// ValueFromMap should convert the Map to a MapValuable type.
ValueFromMap(context.Context, Map) (MapValuable, diag.Diagnostics)
}

Expand All @@ -33,6 +34,7 @@ type MapTypable interface {
type MapValuable interface {
attr.Value

// ToMapValue should convert the value type to a Map.
ToMapValue(ctx context.Context) (Map, diag.Diagnostics)
}

Expand Down
1 change: 1 addition & 0 deletions types/number.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var (
type NumberValuable interface {
attr.Value

// ToNumberValue should convert the value type to a Number.
ToNumberValue(ctx context.Context) (Number, diag.Diagnostics)
}

Expand Down
2 changes: 2 additions & 0 deletions types/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var (
type ObjectTypable interface {
attr.Type

// ValueFromObject should convert the Object to an ObjectValuable type.
ValueFromObject(context.Context, Object) (ObjectValuable, diag.Diagnostics)
}

Expand All @@ -32,6 +33,7 @@ type ObjectTypable interface {
type ObjectValuable interface {
attr.Value

// ToObjectValue should convert the value type to an Object.
ToObjectValue(ctx context.Context) (Object, diag.Diagnostics)
}

Expand Down
5 changes: 5 additions & 0 deletions types/primitive.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var (
type StringTypable interface {
attr.Type

// ValueFromString should convert the String to a StringValuable type.
ValueFromString(context.Context, String) (StringValuable, diag.Diagnostics)
}

Expand All @@ -52,6 +53,7 @@ type StringTypable interface {
type NumberTypable interface {
attr.Type

// ValueFromNumber should convert the Number to a NumberValuable type.
ValueFromNumber(context.Context, Number) (NumberValuable, diag.Diagnostics)
}

Expand All @@ -60,6 +62,7 @@ type NumberTypable interface {
type BoolTypable interface {
attr.Type

// ValueFromBool should convert the Bool to a BoolValuable type.
ValueFromBool(context.Context, Bool) (BoolValuable, diag.Diagnostics)
}

Expand All @@ -68,6 +71,7 @@ type BoolTypable interface {
type Int64Typable interface {
xattr.TypeWithValidate

// ValueFromInt64 should convert the Int64 to a Int64Valuable type.
ValueFromInt64(context.Context, Int64) (Int64Valuable, diag.Diagnostics)
}

Expand All @@ -76,6 +80,7 @@ type Int64Typable interface {
type Float64Typable interface {
xattr.TypeWithValidate

// ValueFromFloat64 should convert the Float64 to a Float64Valuable type.
ValueFromFloat64(context.Context, Float64) (Float64Valuable, diag.Diagnostics)
}

Expand Down
2 changes: 2 additions & 0 deletions types/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var (
type SetTypable interface {
attr.Type

// ValueFromSet should convert the Set to a SetValuable type.
ValueFromSet(context.Context, Set) (SetValuable, diag.Diagnostics)
}

Expand All @@ -33,6 +34,7 @@ type SetTypable interface {
type SetValuable interface {
attr.Value

// ToSetValue should convert the value type to a Set.
ToSetValue(ctx context.Context) (Set, diag.Diagnostics)
}

Expand Down
1 change: 1 addition & 0 deletions types/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (
type StringValuable interface {
attr.Value

// ToStringValue should convert the value type to a String.
ToStringValue(ctx context.Context) (String, diag.Diagnostics)
}

Expand Down

0 comments on commit 59d7778

Please sign in to comment.