github.com/etecs-ru/gnomock@v0.13.2/preset/splunk/options.go (about) 1 package splunk 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 // WithVersion sets splunk version (see 8 // https://hub.docker.com/r/splunk/splunk/tags) for available versions 9 func WithVersion(version string) Option { 10 return func(o *P) { 11 o.Version = version 12 } 13 } 14 15 // WithValues initializes Splunk with the provided values as log entries 16 func WithValues(vs []Event) Option { 17 return func(p *P) { 18 p.Values = vs 19 } 20 } 21 22 // WithValuesFile sets file name to use as a source of initial events to 23 // ingest. These events are ingested first, followed by any other events sent 24 // using WithValues 25 func WithValuesFile(file string) Option { 26 return func(p *P) { 27 p.ValuesFile = file 28 } 29 } 30 31 // WithLicense lets the user choose to accept Splunk enterprise license 32 // (see more at https://hub.docker.com/_/splunk-enterprise). Failure to accept 33 // the license will prevent Splunk container from starting 34 func WithLicense(accept bool) Option { 35 return func(o *P) { 36 o.AcceptLicense = accept 37 } 38 } 39 40 // WithPassword sets admin password in Splunk container. Use this password to 41 // connect to the container when it is ready. Note that Splunk has password 42 // requirements. Failure to meet those will prevent the container from starting 43 // (see defaults at 44 // https://docs.splunk.com/Documentation/Splunk/latest/Security/Configurepasswordsinspecfile) 45 func WithPassword(pass string) Option { 46 return func(o *P) { 47 o.AdminPassword = pass 48 } 49 }