Documentation
¶
Overview ¶
Package ilm contains wrappers that help with creating ILM policies.
Index ¶
- func NewILMAction(options ...Option[*types.IlmActions]) *types.IlmActions
- type ILMPolicy
- type Option
- func WithActions(options ...Option[*types.IlmActions]) Option[*types.Phase]
- func WithDelete() Option[*types.IlmActions]
- func WithForceMergeSegments(segments int) Option[*types.IlmActions]
- func WithMinAge(age string) Option[*types.Phase]
- func WithPhase(name string, options ...Option[*types.Phase]) Option[*types.IlmPolicy]
- func WithRolloverMaxAge(duration string) Option[*types.IlmActions]
- func WithRolloverMaxSize(size string) Option[*types.IlmActions]
- func WithShrinkToShards(shards int) Option[*types.IlmActions]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewILMAction ¶
func NewILMAction(options ...Option[*types.IlmActions]) *types.IlmActions
NewILMAction creates a new ILM action for with the given options.
Types ¶
type ILMPolicy ¶
type ILMPolicy struct {
*putlifecycle.Request
Name string
}
ILMPolicy represents an index lifecycle management policy.
func NewILMPolicy ¶
NewILMPolicy creates a new ILM policy with the given options and encapsulates it in an appropriate request object.
func (*ILMPolicy) Put ¶
func (p *ILMPolicy) Put(ctx context.Context, api *elasticsearch.TypedClient) error
Put will send a request to create the index template in the cluster.
type Option ¶
type Option[T any] func(T)
Option is a reusable generic function for applying options to a type.
func WithActions ¶
WithActions adds the given actions to the phase.
https://www.elastic.co/docs/reference/elasticsearch/index-lifecycle-actions/
func WithDelete ¶
func WithDelete() Option[*types.IlmActions]
WithDelete will add a delete action to the phase.
func WithForceMergeSegments ¶
func WithForceMergeSegments(segments int) Option[*types.IlmActions]
WithForceMergeSegments will apply a force merge action to the phase that will force merge indices to the given number of segments.
func WithMinAge ¶
WithMinAge defines the minimum age at which this phase applies.
func WithRolloverMaxAge ¶
func WithRolloverMaxAge(duration string) Option[*types.IlmActions]
WithRolloverMaxAge will apply a rollover action to the phase that will rollover indices older than the given duration.
func WithRolloverMaxSize ¶
func WithRolloverMaxSize(size string) Option[*types.IlmActions]
WithRolloverMaxSize will apply a rollover action to the phase that will rollover indices larger than the given size.
func WithShrinkToShards ¶
func WithShrinkToShards(shards int) Option[*types.IlmActions]
WithShrinkToShards will apply a shrink action to the phase that will shrink indices to the given number of shards.