category

package
v0.0.0-...-f94be1b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ACLsFor

func ACLsFor(categories ...Category) []acl.ACL

ACLsFor given categories returns a list of all the acls that belong to those categories.

func NewContext

func NewContext(ctx context.Context, c *Category) context.Context

NewContext returns a new context with the given Category.

Types

type Category

type Category int

Category represents category type

const (
	Docs Category = iota
	Search
	Indices
	Cat
	Clusters
	Misc
	User
	Permission
	Analytics
	Streams
	Rules
	Suggestions
	Auth
	ReactiveSearch
	SearchRelevancy
	Synonyms
	SearchGrader
	UIBuilder
	Logs
	Cache
	StoredQuery
	Sync
	Pipelines
)

Currently supported category.

func FromContext

func FromContext(ctx context.Context) (*Category, error)

FromContext retrieves the category stored against the category.CtxKey from the context.

func FromString

func FromString(tag string) Category

FromString returns the Categories from string tags.

func (Category) ACLs

func (c Category) ACLs() []acl.ACL

ACLs returns the categories associated with the category.

func (Category) HasACL

func (c Category) HasACL(a acl.ACL) bool

HasACL checks whether the given acl is a value in the category categories.

func (Category) IsFromES

func (c Category) IsFromES() bool

IsFromES checks whether the category is one of the elasticsearch category, i.e. one of [docs, search, indices, cat, clusters, misc]

func (Category) IsFromRS

func (c Category) IsFromRS() bool

IsFromRS checks whether the category is of the reactivesearch category.

func (Category) JSONSchema

func (c Category) JSONSchema() *jsonschema.Schema

func (Category) MarshalJSON

func (c Category) MarshalJSON() ([]byte, error)

MarshalJSON is the implementation of Marshaler interface for marshaling category.Categories type.

func (Category) String

func (c Category) String() string

String is an implementation of Stringer interface that returns the string representation of category.Categories.

func (*Category) UnmarshalJSON

func (c *Category) UnmarshalJSON(bytes []byte) error

UnmarshalJSON is an implementation of Unmarshaler interface for unmarshaling category.Categories.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL