Documentation
¶
Index ¶
- Variables
- func IsNotFound(err error) bool
- type FilterSegment
- type FilterSegmentList
- type Handler
- func (h *Handler) Create(ctx context.Context, data []byte) (*FilterSegment, error)
- func (h *Handler) Delete(ctx context.Context, uid string) error
- func (h *Handler) Get(ctx context.Context, uid string, addFields ...string) (*FilterSegment, error)
- func (h *Handler) List(ctx context.Context, addFields ...string) (*FilterSegmentList, error)
- func (h *Handler) Update(ctx context.Context, uid string, version int, data []byte) error
- type Include
- type Variables
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("segment not found")
ErrNotFound is returned when a segment is not found (HTTP 404).
Functions ¶
func IsNotFound ¶
IsNotFound returns true if the error indicates a segment was not found (404).
Types ¶
type FilterSegment ¶
type FilterSegment struct {
UID string `json:"uid"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
IsPublic bool `json:"isPublic"`
Owner string `json:"owner,omitempty"`
Version int `json:"version,omitempty"`
IsReadyMade bool `json:"isReadyMade,omitempty"`
Includes []Include `json:"includes,omitempty"`
Variables *Variables `json:"variables,omitempty"`
AllowedOperations []string `json:"allowedOperations,omitempty"`
}
FilterSegment is the read model for a Grail filter segment.
type FilterSegmentList ¶
type FilterSegmentList struct {
FilterSegments []FilterSegment `json:"filterSegments"`
TotalCount int `json:"totalCount,omitempty"`
}
FilterSegmentList represents a list of filter segments.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles Grail filter segment resources.
func NewHandler ¶
func NewHandler(c *httpclient.Client) *Handler
NewHandler creates a new segment handler.
func (*Handler) Create ¶
Create creates a new filter segment. The data should be JSON with the segment definition in the format the API expects (filter fields as JSON AST strings).
func (*Handler) Get ¶
Get gets a specific filter segment by UID. Use addFields to request optional fields (e.g., "INCLUDES", "VARIABLES").