Skip to content

confighttp: embed confignet.AddrConfig in confighttp.ServerConfig #14187

@axw

Description

@axw

See #14058 (comment)

I would like to make confighttp.ServerConfig and configgrpc.ServerConfig more consistent by embedding confignet.AddrConfig in the confighttp struct like we do in configgrpc.

i.e. remove this:

type ServerConfig struct {
// Endpoint configures the listening address for the server.
Endpoint string `mapstructure:"endpoint,omitempty"`

and add something equivalent to this:

type ServerConfig struct {
// Server net.Addr config. For transport only "tcp" and "unix" are valid options.
NetAddr confignet.AddrConfig `mapstructure:",squash"`

By doing this, we would have a more natural place to add things like #14058 which should be common to both gRPC and HTTP servers. It would also enable HTTP servers to bind to Unix domain sockets: #8752

This would be a breaking API change, so should be done before #9380.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions