Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Commit

Permalink
Add project.GetName()
Browse files Browse the repository at this point in the history
Currently we don't have a way to access the name of projects, which
are sometimes normalized internally.

Signed-off-by: Iwasaki Yudai <[email protected]>
  • Loading branch information
yudai committed May 5, 2017
1 parent c6a7d46 commit ae18b21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions project/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type APIProject interface {
Load(bytes []byte) error
Containers(ctx context.Context, filter Filter, services ...string) ([]string, error)

GetName() string
GetServiceConfig(service string) (*config.ServiceConfig, bool)
}

Expand Down
5 changes: 5 additions & 0 deletions project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,11 @@ func (p *Project) Notify(eventType events.EventType, serviceName string, data ma
}
}

// GetName returns the name of the project.
func (p *Project) GetName() string {
return p.Name
}

// GetServiceConfig looks up a service config for a given service name, returning the ServiceConfig
// object and a bool flag indicating whether it was found
func (p *Project) GetServiceConfig(name string) (*config.ServiceConfig, bool) {
Expand Down

0 comments on commit ae18b21

Please sign in to comment.