github.com/projecteru2/core@v0.0.0-20240321043226-06bcc1c23f58/store/options.go (about)

     1  package store
     2  
     3  type Op struct {
     4  	WithoutEngine bool
     5  }
     6  
     7  type Option func(*Op)
     8  
     9  func WithoutEngineOption() Option {
    10  	return func(op *Op) {
    11  		op.WithoutEngine = true
    12  	}
    13  }
    14  
    15  func NewOp(opts ...Option) *Op {
    16  	op := &Op{}
    17  	for _, opt := range opts {
    18  		opt(op)
    19  	}
    20  	return op
    21  }