Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 6aaee2d

Browse files
committed
Add project.GetName()
Currently we don't have a way to access the name of projects, which are sometimes normalized internally.
1 parent c6a7d46 commit 6aaee2d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

project/interface.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type APIProject interface {
4040
Load(bytes []byte) error
4141
Containers(ctx context.Context, filter Filter, services ...string) ([]string, error)
4242

43+
GetName() string
4344
GetServiceConfig(service string) (*config.ServiceConfig, bool)
4445
}
4546

project/project.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,11 @@ func (p *Project) Notify(eventType events.EventType, serviceName string, data ma
540540
}
541541
}
542542

543+
// GetName returns the name of the project.
544+
func (p *Project) GetName() string {
545+
return p.Name
546+
}
547+
543548
// GetServiceConfig looks up a service config for a given service name, returning the ServiceConfig
544549
// object and a bool flag indicating whether it was found
545550
func (p *Project) GetServiceConfig(name string) (*config.ServiceConfig, bool) {

0 commit comments

Comments
 (0)