Skip to content

Commit

Permalink
Change to EntityInfo to EntityDefinition (#338)
Browse files Browse the repository at this point in the history
* change from EntityInfo to EntityDefinition

* modify change log
  • Loading branch information
klnusbaum authored and phliar committed Jun 4, 2018
1 parent 9175a32 commit a589707
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- Convert usernaems to lowercase when constructing scope names etc. (#322)
- Initial support for Adaptive Rate Limits.
- Many accidentally exported names have been unexported. (#327)
- Add new GetEntitySchema function to the Connector interface (#335)
- Add new GetEntitySchema function to the Connector interface (#335 and #338)
- Remove unused PluginFunc argument from the routing connector (#337)

## v2.6.0 (2018-04-16)
Expand Down
2 changes: 1 addition & 1 deletion connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ type Connector interface {
// CheckSchemaStatus checks the status of the schema whether it is accepted or in progress of application.
CheckSchemaStatus(ctx context.Context, scope string, namePrefix string, version int32) (*SchemaStatus, error)
// GetEntitySchema returns the entity info for a given entity in a given scope and prefix.
GetEntitySchema(ctx context.Context, scope, namePrefix, entityName string, version int32) (*EntityInfo, error)
GetEntitySchema(ctx context.Context, scope, namePrefix, entityName string, version int32) (*EntityDefinition, error)

// Datastore management
// CreateScope creates a scope for storage of data, usually implemented by a keyspace for this data
Expand Down
2 changes: 1 addition & 1 deletion connectors/base/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (c *Connector) CheckSchemaStatus(ctx context.Context, scope string, namePre
}

// GetEntitySchema calls next
func (c *Connector) GetEntitySchema(ctx context.Context, scope, namePrefix, entityName string, version int32) (*dosa.EntityInfo, error) {
func (c *Connector) GetEntitySchema(ctx context.Context, scope, namePrefix, entityName string, version int32) (*dosa.EntityDefinition, error) {
if c.Next == nil {
return nil, NewErrNoMoreConnector()
}
Expand Down
4 changes: 2 additions & 2 deletions connectors/devnull/devnull.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ func (c *Connector) CheckSchemaStatus(ctx context.Context, scope, namePrefix str
}

// GetEntitySchema always returns a blank EntityInfo and no error.
func (c *Connector) GetEntitySchema(ctx context.Context, scope, namePrefix, entityName string, version int32) (*dosa.EntityInfo, error) {
return &dosa.EntityInfo{}, nil
func (c *Connector) GetEntitySchema(ctx context.Context, scope, namePrefix, entityName string, version int32) (*dosa.EntityDefinition, error) {
return &dosa.EntityDefinition{}, nil
}

// CreateScope returns success
Expand Down
4 changes: 2 additions & 2 deletions connectors/random/random.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ func (c *Connector) CheckSchemaStatus(ctx context.Context, scope, namePrefix str
}

// GetEntitySchema always returns a blank EntityInfo and no error.
func (c *Connector) GetEntitySchema(ctx context.Context, scope, namePrefix, entityName string, version int32) (*dosa.EntityInfo, error) {
return &dosa.EntityInfo{}, nil
func (c *Connector) GetEntitySchema(ctx context.Context, scope, namePrefix, entityName string, version int32) (*dosa.EntityDefinition, error) {
return &dosa.EntityDefinition{}, nil
}

// CreateScope returns success
Expand Down
2 changes: 1 addition & 1 deletion connectors/routing/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (rc *Connector) CheckSchemaStatus(ctx context.Context, scope string, namePr
}

// GetEntitySchema calls the selected connector
func (rc *Connector) GetEntitySchema(ctx context.Context, scope, namePrefix, entityName string, version int32) (*dosa.EntityInfo, error) {
func (rc *Connector) GetEntitySchema(ctx context.Context, scope, namePrefix, entityName string, version int32) (*dosa.EntityDefinition, error) {
connector, err := rc.getConnector(scope, namePrefix)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion connectors/yarpc/yarpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ func (c *Connector) CheckSchemaStatus(ctx context.Context, scope, namePrefix str
}

// GetEntitySchema gets the schema for the specified entity.
func (c *Connector) GetEntitySchema(ctx context.Context, scope, namePrefix, entityName string, version int32) (*dosa.EntityInfo, error) {
func (c *Connector) GetEntitySchema(ctx context.Context, scope, namePrefix, entityName string, version int32) (*dosa.EntityDefinition, error) {
// We're not going to implement this at the moment since it's not needed. However, it could be easily
// implemented by adding a new method to the thrift idl
panic("Not implemented")
Expand Down
3 changes: 2 additions & 1 deletion mocks/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions mocks/connector.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a589707

Please sign in to comment.