func (ar *AbstractResource) GetAll(request *http.Request) (map[string]Attributes, error) {
	return nil, nil
}
GetAll returns all instances for resources with multiple instances
package restful
import (
	"bytes"
	"encoding/json"
	"io"
	"net/http"
	"strconv"
	"time"
	"github.com/nuclio/nuclio/pkg/common"
	"github.com/nuclio/nuclio/pkg/registry"
	"github.com/go-chi/chi/v5"
	"github.com/nuclio/errors"
	"github.com/nuclio/logger"
	"github.com/nuclio/nuclio-sdk-go"
)
type Attributes map[string]interface{}
type CustomRouteFuncResponse struct {
	ResourceType string
	Resources    map[string]Attributes
	Headers      map[string]string
	Single     bool
	StatusCode int
}
type CustomRouteFuncStreamResponse struct {
	Headers       map[string]string
	StatusCode    int
	ForceFlush    bool
	FlushInternal time.Duration
	ReadCloser    io.ReadCloser
}
type CustomRouteFunc func(*http.Request) (*CustomRouteFuncResponse, error)
type CustomRouteFuncStream func(*http.Request) (*CustomRouteFuncStreamResponse, error)
type CustomRoute struct {
	Stream          bool
	Pattern         string
	Method          string
	RouteFunc       CustomRouteFunc
	StreamRouteFunc CustomRouteFuncStream
}
type Resource interface {
	Initialize(logger.Logger, Server) (chi.Router, error)
	ExtendMiddlewares() error
	OnAfterInitialize() error
	GetCustomRoutes() ([]CustomRoute, error)
	GetAll(request *http.Request) (map[string]Attributes, error)
	GetByID(request *http.Request, id string) (Attributes, error)
	Create(request *http.Request) (string, Attributes, error)
	Update(request *http.Request, id string) (Attributes, error)
	Delete(request *http.Request, id string) error
}
type ResourceMethod int
const (
	ResourceMethodGetList ResourceMethod = iota
	ResourceMethodGetDetail
	ResourceMethodCreate
	ResourceMethodUpdate
	ResourceMethodDelete
)
const (
	ParamImport = "import"
	ParamExport = "export"
)
type AbstractResource struct {
	Logger   logger.Logger
	Resource Resource
	name            string
	router          chi.Router
	resourceMethods []ResourceMethod
	server          Server
	encoderFactory  EncoderFactory
}
func NewAbstractResource(name string, resourceMethods []ResourceMethod) *AbstractResource {
	return &AbstractResource{
		name:            name,
		resourceMethods: resourceMethods,
		encoderFactory:  &JSONEncoderFactory{},
	}
}
func (ar *AbstractResource) Initialize(parentLogger logger.Logger, server Server) (chi.Router, error) {
	ar.Logger = parentLogger.GetChild(ar.name)
	ar.server = server
	ar.router = chi.NewRouter()
	if err := ar.Resource.ExtendMiddlewares(); err != nil {
		return nil, errors.Wrap(err, "ExtendMiddlewares returned error")
	}
	if err := ar.registerRoutes(); err != nil {
		return nil, errors.Wrap(err, "Failed to register routes")
	}
	if err := ar.Resource.OnAfterInitialize(); err != nil {
		return nil, errors.Wrap(err, "OnAfterInitialize returned error")
	}
	return ar.router, nil
}
func (ar *AbstractResource) Register(registry *registry.Registry) {
	registry.Register(ar.name, ar)
}
func (ar *AbstractResource) GetName() string {
	return ar.name
}
func (ar *AbstractResource) GetServer() Server {
	return ar.server
}
func (ar *AbstractResource) OnAfterInitialize() error {
	return nil
}