github.com/rudderlabs/rudder-go-kit@v0.30.0/testhelper/docker/resource/postgres/config.go (about)

     1  package postgres
     2  
     3  type Opt func(*Config)
     4  
     5  func WithTag(tag string) Opt {
     6  	return func(c *Config) {
     7  		c.Tag = tag
     8  	}
     9  }
    10  
    11  func WithOptions(options ...string) Opt {
    12  	return func(c *Config) {
    13  		c.Options = options
    14  	}
    15  }
    16  
    17  func WithShmSize(shmSize int64) Opt {
    18  	return func(c *Config) {
    19  		c.ShmSize = shmSize
    20  	}
    21  }
    22  
    23  func WithMemory(memory int64) Opt {
    24  	return func(c *Config) {
    25  		c.Memory = memory
    26  	}
    27  }
    28  
    29  func WithOOMKillDisable(disable bool) Opt {
    30  	return func(c *Config) {
    31  		c.OOMKillDisable = disable
    32  	}
    33  }
    34  
    35  func WithPrintLogsOnError(printLogsOnError bool) Opt {
    36  	return func(c *Config) {
    37  		c.PrintLogsOnError = printLogsOnError
    38  	}
    39  }
    40  
    41  type Config struct {
    42  	Tag              string
    43  	Options          []string
    44  	ShmSize          int64
    45  	Memory           int64
    46  	OOMKillDisable   bool
    47  	PrintLogsOnError bool
    48  }