service/role/service.go
func New(config Config) (Service, error) {
	// Dependencies.
	if config.VaultClient == nil {
		return nil, microerror.Maskf(invalidConfigError, "Vault client must not be empty")
	}

	if config.PKIMountpoint == "" {
		return nil, microerror.Maskf(invalidConfigError, "PKIMountpoint must not be empty")
	}

	service := &service{
		vaultClient:   config.VaultClient,
		pkiMountpoint: config.PKIMountpoint,
	}

	return service, nil
}
func New(config Config) (Service, error) {
	// Dependencies.
	if config.VaultClient == nil {
		return nil, microerror.Maskf(invalidConfigError, "Vault client must not be empty")
	}

	if config.PKIMountpoint == "" {
		return nil, microerror.Maskf(invalidConfigError, "PKIMountpoint must not be empty")
	}

	service := &service{
		vaultClient:   config.VaultClient,
		pkiMountpoint: config.PKIMountpoint,
	}

	return service, nil
}
// New takes a configuration and returns a configured service.