You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: create_portal_link.go
    path of file: ./repos/convoy/services
    
    the code of the file until where you have to start completion: package services

import (
	"context"
	"errors"
	"fmt"
	"time"

	"github.com/frain-dev/convoy/pkg/log"

	"github.com/dchest/uniuri"
	"github.com/frain-dev/convoy/api/models"
	"github.com/frain-dev/convoy/datastore"
	"github.com/frain-dev/convoy/util"
	"github.com/oklog/ulid/v2"
)

var ErrInvalidEndpoints = errors.New("endpoints cannot be empty")

type CreatePortalLinkService struct {
	PortalLinkRepo datastore.PortalLinkRepository
	EndpointRepo   datastore.EndpointRepository

	Portal  *models.PortalLink
	Project *datastore.Project
}

func (p *CreatePortalLinkService) Run(ctx context.Context) (*data
    
func findEndpoints(ctx context.Context, endpoints []string, project *datastore.Project, endpointRepo datastore.EndpointRepository) error {
	for _, e := range endpoints {
		endpoint, err := endpointRepo.FindEndpointByID(ctx, e, project.UID)
		log.FromContext(ctx).WithError(err).Errorf("failed to find endpoint %s", e)
		if errors.Is(err, datastore.ErrEndpointNotFound) {
			return &ServiceError{ErrMsg: fmt.Sprintf("endpoint with ID :%s not found", e), Err: err}
		}

		if endpoint.ProjectID != project.UID {
			return &ServiceError{ErrMsg: fmt.Sprintf("unauthorized access to endpoint with ID: %s", e)}
		}
	}

	return nil
}