func parseAndCheckParameters(params ...Parameter) (*parameters, error) {
	parameters := parameters{
		logLevel: zerolog.GlobalLevel(),
	}
	for _, p := range params {
		if params != nil {
			p.apply(&parameters)
		}
	}
	if len(parameters.graffiti) > 32 {
		return nil, errors.New("graffiti has a maximum size of 32 bytes")
	}
	return &parameters, nil
}
parseAndCheckParameters parses and checks parameters to ensure that mandatory parameters are present and correct.
package static
import (
	"errors"
	"github.com/rs/zerolog"
)
type parameters struct {
	logLevel zerolog.Level
	graffiti []byte
}
type Parameter interface {
	apply(*parameters)
}
type parameterFunc func(*parameters)
func (f parameterFunc) apply(p *parameters) {
	f(p)
}
func WithLogLevel(logLevel zerolog.Level) Parameter {
	return parameterFunc(func(p *parameters) {
		p.logLevel = logLevel
	})
}
func WithGraffiti(graffiti []byte) Parameter {
	return parameterFunc(func(p *parameters) {
		p.graffiti = graffiti
	})
}