Implement get route subcommand
This commit is contained in:
@ -7,6 +7,15 @@ import (
|
||||
"gitea.libretechconsulting.com/50W/eia-api-go/pkg/eia"
|
||||
)
|
||||
|
||||
func GetRoute(cmd *cobra.Command, route string) (*eiaapi.FinalRoute, error) {
|
||||
client, err := Client(cmd)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return client.GetRoute(cmd.Context(), route, eia.DefaultMethodSubs(cmd.Context()))
|
||||
}
|
||||
|
||||
func GetFacet(cmd *cobra.Command, route string, facet string) (*eiaapi.FacetDetails, error) {
|
||||
client, err := Client(cmd)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user