Skip to content

fix typos #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: libovsb-ci
name: libovsdb-ci

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/images.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: libovsb-images
name: libovsdb-images

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ exact contribution history, see the commit history.

Modifications Copyright 2018-2019 eBay Inc.

This software contains modifications developed by eBay Inc. and voluntary contibutions
This software contains modifications developed by eBay Inc. and voluntary contributions
from other individuals in a fork maintained at https://github.com/eBay/libovsdb
For details on these contributions, please consult the git history.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
libovsdb
========

[![libovsb-ci](https://github.com/ovn-org/libovsdb/actions/workflows/ci.yml/badge.svg)](https://github.com/ovn-org/libovsdb/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/github/ovn-org/libovsdb/badge.svg?branch=main)](https://coveralls.io/github/ovn-org/libovsdb?branch=main) [![Go Report Card](https://goreportcard.com/badge/github.com/ovn-org/libovsdb)](https://goreportcard.com/report/github.com/ovn-org/libovsdb)
[![libovsdb-ci](https://github.com/ovn-org/libovsdb/actions/workflows/ci.yml/badge.svg)](https://github.com/ovn-org/libovsdb/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/github/ovn-org/libovsdb/badge.svg?branch=main)](https://coveralls.io/github/ovn-org/libovsdb?branch=main) [![Go Report Card](https://goreportcard.com/badge/github.com/ovn-org/libovsdb)](https://goreportcard.com/report/github.com/ovn-org/libovsdb)

An OVSDB Library written in Go

Expand Down
6 changes: 3 additions & 3 deletions cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ func (e *EventHandlerFuncs) OnDelete(table string, row model.Model) {

// TableCache contains a collection of RowCaches, hashed by name,
// and an array of EventHandlers that respond to cache updates
// It implements the ovsdb.NotifcationHandler interface so it may
// It implements the ovsdb.NotificationHandler interface so it may
// handle update notifications
type TableCache struct {
cache map[string]*RowCache
Expand All @@ -413,7 +413,7 @@ type TableCache struct {
mutex sync.RWMutex
}

// Data is the type for data that can be prepoulated in the cache
// Data is the type for data that can be prepopulated in the cache
type Data map[string]map[string]model.Model

// NewTableCache creates a new TableCache
Expand Down Expand Up @@ -589,7 +589,7 @@ func newColumnToValue(schemaIndexes [][]string) columnToValue {
// RFC 7047 says that Indexes is a [<column-set>] and "Each <column-set> is a set of
// columns whose values, taken together within any given row, must be
// unique within the table". We'll store the column names, separated by comma
// as we'll assuume (RFC is not clear), that comma isn't valid in a <id>
// as we'll assume (RFC is not clear), that comma isn't valid in a <id>
var indexes []index
for i := range schemaIndexes {
indexes = append(indexes, newIndex(schemaIndexes[i]...))
Expand Down
2 changes: 1 addition & 1 deletion client/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Using it, the libovsdb.client package is able to properly encode and decode OVSD
and store them in Model instances.
A client instance is created by simply specifying the connection information and the database model:
ovs, _ := client.Connect(contect.Background(), dbModel)
ovs, _ := client.Connect(context.Background(), dbModel)
Main API
Expand Down
6 changes: 3 additions & 3 deletions mapper/mapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func TestMapperNewRow(t *testing.T) {
assert.NotNil(t, err)
} else {
assert.Nil(t, err)
assert.Equalf(t, test.expectedRow, row, "NewRow should match expeted")
assert.Equalf(t, test.expectedRow, row, "NewRow should match expected")
}
})
}
Expand Down Expand Up @@ -437,7 +437,7 @@ func TestMapperNewRowFields(t *testing.T) {
assert.NotNil(t, err)
} else {
assert.Nil(t, err)
assert.Equalf(t, test.expectedRow, row, "NewRow should match expeted")
assert.Equalf(t, test.expectedRow, row, "NewRow should match expected")
}
})
}
Expand Down Expand Up @@ -965,7 +965,7 @@ func TestMapperMutation(t *testing.T) {
err: true,
},
{
name: "Add elemet to set ",
name: "Add element to set ",
column: "set",
obj: testType{},
mutator: ovsdb.MutateOperationInsert,
Expand Down
4 changes: 2 additions & 2 deletions ovsdb/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (c *Condition) UnmarshalJSON(b []byte) error {

// Evaluate will evaluate the condition on the two provided values
// The conditions operately differently depending on the type of
// the provided values. The behavjour is as described in RFC7047
// the provided values. The behavior is as described in RFC7047
func (c ConditionFunction) Evaluate(a interface{}, b interface{}) (bool, error) {
x := reflect.ValueOf(a)
y := reflect.ValueOf(b)
Expand Down Expand Up @@ -163,7 +163,7 @@ func (c ConditionFunction) Evaluate(a interface{}, b interface{}) (bool, error)
return false, fmt.Errorf("condition not supported on %s", x.Kind())
}
default:
return false, fmt.Errorf("unsuported condition function %s", c)
return false, fmt.Errorf("unsupported condition function %s", c)
}
// we should never get here
return false, fmt.Errorf("unreachable condition")
Expand Down
2 changes: 1 addition & 1 deletion ovsdb/encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func TestSet(t *testing.T) {
`["set",[["named-uuid","aa"],["named-uuid","bb"]]]`,
},
{
"valud uuid",
"valid uuid",
validUUID0,
fmt.Sprintf(`["uuid","%v"]`, validUUIDStr0),
},
Expand Down
4 changes: 2 additions & 2 deletions ovsdb/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

// OvsMap is the JSON map structure used for OVSDB
// RFC 7047 uses the following notation for map as JSON doesnt support non-string keys for maps.
// RFC 7047 uses the following notation for map as JSON doesn't support non-string keys for maps.
// A 2-element JSON array that represents a database map value. The
// first element of the array must be the string "map", and the
// second element must be an array of zero or more <pair>s giving the
Expand All @@ -34,7 +34,7 @@ func (o OvsMap) MarshalJSON() ([]byte, error) {
return []byte("[\"map\",[]]"), nil
}

// UnmarshalJSON unmarshalls an OVSDB style Map from a byte array
// UnmarshalJSON unmarshals an OVSDB style Map from a byte array
func (o *OvsMap) UnmarshalJSON(b []byte) (err error) {
var oMap []interface{}
o.GoMap = make(map[interface{}]interface{})
Expand Down
2 changes: 1 addition & 1 deletion ovsdb/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewLockArgs(id interface{}) []interface{} {
return []interface{}{id}
}

// NotificationHandler is the interface that must be implemented to receive notifcations
// NotificationHandler is the interface that must be implemented to receive notifications
type NotificationHandler interface {
// RFC 7047 section 4.1.6 Update Notification
Update(context interface{}, tableUpdates TableUpdates)
Expand Down
2 changes: 1 addition & 1 deletion ovsdb/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ func (c *ColumnSchema) Ephemeral() bool {
return false
}

// UnmarshalJSON unmarshalls a json-formatted column
// UnmarshalJSON unmarshals a json-formatted column
func (c *ColumnSchema) UnmarshalJSON(data []byte) error {
// ColumnJSON represents the known json values for a Column
var colJSON struct {
Expand Down
20 changes: 10 additions & 10 deletions ovsdb/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func TestSchema(t *testing.T) {
"columns": {
"wrongType": {
"type": {
"key": "uknown"
"key": "unknown"
}
}
}
Expand Down Expand Up @@ -317,7 +317,7 @@ func TestSchema(t *testing.T) {
}
if !reflect.DeepEqual(test.expectedSchema, schema) {
t.Errorf("expected schema to be %+#v, but got: %+#v", test.expectedSchema, schema)
// Struct Instrospection for debugging purpuses
// Struct Introspection for debugging purposes
for tname, table := range schema.Tables {
for n, c := range table.Columns {
ec := test.expectedSchema.Tables[tname].Columns[n]
Expand Down Expand Up @@ -602,7 +602,7 @@ func TestColumnSchemaEphemeral(t *testing.T) {

func TestColumnSchemaMarshalUnmarshalJSON(t *testing.T) {
datapath := "Datapath"
unlimted := -1
unlimited := -1
zero := 0
one := 1
tests := []struct {
Expand All @@ -629,7 +629,7 @@ func TestColumnSchemaMarshalUnmarshalJSON(t *testing.T) {
Key: &BaseType{Type: TypeString},
Value: &BaseType{Type: TypeUUID, refTable: &datapath},
min: &zero,
max: &unlimted,
max: &unlimited,
},
},
[]byte(`{"type":{"key": {"type": "string"},"value": {"type": "uuid","refTable": "Datapath"},"min": 0, "max": "unlimited"}}`),
Expand All @@ -642,7 +642,7 @@ func TestColumnSchemaMarshalUnmarshalJSON(t *testing.T) {
TypeObj: &ColumnType{
Key: &BaseType{Type: TypeUUID, refTable: &datapath},
min: &zero,
max: &unlimted,
max: &unlimited,
}},
[]byte(`{"type": {"key": {"type": "uuid","refTable": "Datapath"},"min": 0, "max": "unlimited"}}`),
},
Expand Down Expand Up @@ -1004,7 +1004,7 @@ func TestBaseTypeRefType(t *testing.T) {

func TestColumnSchema_String(t *testing.T) {
datapath := "Connection"
unlimted := -1
unlimited := -1
zero := 0
strong := "strong"
weak := "weak"
Expand Down Expand Up @@ -1048,7 +1048,7 @@ func TestColumnSchema_String(t *testing.T) {
TypeObj: &ColumnType{
Key: &BaseType{Type: TypeUUID, refTable: &datapath},
min: &zero,
max: &unlimted,
max: &unlimited,
},
},
"[] [Connection (strong)] (min: 0, max: -1) [M]",
Expand All @@ -1060,7 +1060,7 @@ func TestColumnSchema_String(t *testing.T) {
TypeObj: &ColumnType{
Key: &BaseType{Type: TypeUUID, refTable: &datapath, refType: &strong},
min: &zero,
max: &unlimted,
max: &unlimited,
},
},
"[] [Connection (strong)] (min: 0, max: -1) [M]",
Expand All @@ -1072,7 +1072,7 @@ func TestColumnSchema_String(t *testing.T) {
TypeObj: &ColumnType{
Key: &BaseType{Type: TypeUUID, refTable: &datapath, refType: &weak},
min: &zero,
max: &unlimted,
max: &unlimited,
},
},
"[] [Connection (weak)] (min: 0, max: -1) [M]",
Expand All @@ -1083,7 +1083,7 @@ func TestColumnSchema_String(t *testing.T) {
Type: TypeEnum,
TypeObj: &ColumnType{
Key: &BaseType{Type: TypeString, Enum: []interface{}{"permit", "deny"}},
max: &unlimted,
max: &unlimited,
min: &zero,
},
},
Expand Down