func (c *Client) ListServices() ([]client.Service, error) {
	services, err := c.rancherClient.Service.List(&client.ListOpts{
		Filters: map[string]interface{}{
			"stackId": c.functionsStackID,
		},
	})
	if err != nil {
		return nil, err
	}
	return services.Data, nil
}
ListServices lists rancher services inside the specified stack (set in config)
package rancher
import (
	"fmt"
	"github.com/rancher/go-rancher/v2"
)
type BridgeClient interface {
	ListServices() ([]client.Service, error)
	FindServiceByName(name string) (*client.Service, error)
	CreateService(spec *client.Service) (*client.Service, error)
	DeleteService(spec *client.Service) error
	UpdateService(spec *client.Service, updates map[string]string) (*client.Service, error)
}
type Client struct {
	rancherClient    *client.RancherClient
	config           *Config
	functionsStackID string
}
func NewClientForConfig(config *Config) (BridgeClient, error) {
	c, newErr := client.NewRancherClient(&client.ClientOpts{
		Url:       config.CattleURL,
		AccessKey: config.CattleAccessKey,
		SecretKey: config.CattleSecretKey,
	})
	if newErr != nil {
		return nil, newErr
	}
	coll, listErr := c.Stack.List(&client.ListOpts{
		Filters: map[string]interface{}{
			"name": config.FunctionsStackName,
		},
	})
	if listErr != nil {
		return nil, listErr
	}
	var stack *client.Stack
	if len(coll.Data) == 0 {
		fmt.Println("stack named " + config.FunctionsStackName + " not found. creating...")
		reqStack := &client.Stack{
			Name: config.FunctionsStackName,
		}
		newStack, err := c.Stack.Create(reqStack)
		if err != nil {
			return nil, err
		}
		fmt.Println("stack creation complete")
		stack = newStack
	} else {
		stack = &coll.Data[0]
	}
	client := Client{
		rancherClient:    c,
		config:           config,
		functionsStackID: stack.Id,
	}
	return &client, nil
}