github.com/etecs-ru/gnomock@v0.13.2/preset/memcached/options.go (about)

     1  package memcached
     2  
     3  // Option is an optional configuration of this Gnomock preset. Use available
     4  // Options to configure the container
     5  type Option func(*P)
     6  
     7  // WithValues initializes Memcached with the provided key/value pairs. These values
     8  // never expire. Only strings are supported.
     9  func WithValues(vs map[string]string) Option {
    10  	return func(p *P) {
    11  		p.Values = vs
    12  	}
    13  }
    14  
    15  // WithByteValues initializes Memcached with the provided key/value paris. These values
    16  // never expire. Only byte slices are supported.
    17  func WithByteValues(vs map[string][]byte) Option {
    18  	return func(p *P) {
    19  		p.ByteValues = vs
    20  	}
    21  }
    22  
    23  // WithVersion sets image version.
    24  func WithVersion(version string) Option {
    25  	return func(o *P) {
    26  		o.Version = version
    27  	}
    28  }