github.com/minio/minio@v0.0.0-20240328213742-3f72439b8a27/internal/config/dns/types.go (about)

     1  // Copyright (c) 2015-2021 MinIO, Inc.
     2  //
     3  // This file is part of MinIO Object Storage stack
     4  //
     5  // This program is free software: you can redistribute it and/or modify
     6  // it under the terms of the GNU Affero General Public License as published by
     7  // the Free Software Foundation, either version 3 of the License, or
     8  // (at your option) any later version.
     9  //
    10  // This program is distributed in the hope that it will be useful
    11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13  // GNU Affero General Public License for more details.
    14  //
    15  // You should have received a copy of the GNU Affero General Public License
    16  // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    17  
    18  package dns
    19  
    20  import (
    21  	"encoding/json"
    22  	"time"
    23  )
    24  
    25  const (
    26  	defaultTTL            = 30
    27  	defaultContextTimeout = 5 * time.Minute
    28  )
    29  
    30  // SrvRecord - represents a DNS service record
    31  type SrvRecord struct {
    32  	Host     string      `json:"host,omitempty"`
    33  	Port     json.Number `json:"port,omitempty"`
    34  	Priority int         `json:"priority,omitempty"`
    35  	Weight   int         `json:"weight,omitempty"`
    36  	Text     string      `json:"text,omitempty"`
    37  	Mail     bool        `json:"mail,omitempty"` // Be an MX record. Priority becomes Preference.
    38  	TTL      uint32      `json:"ttl,omitempty"`
    39  
    40  	// Holds info about when the entry was created first.
    41  	CreationDate time.Time `json:"creationDate"`
    42  
    43  	// When a SRV record with a "Host: IP-address" is added, we synthesize
    44  	// a srv.Target domain name.  Normally we convert the full Key where
    45  	// the record lives to a DNS name and use this as the srv.Target. When
    46  	// TargetStrip > 0 we strip the left most TargetStrip labels from the
    47  	// DNS name.
    48  	TargetStrip int `json:"targetstrip,omitempty"`
    49  
    50  	// Group is used to group (or *not* to group) different services
    51  	// together. Services with an identical Group are returned in
    52  	// the same answer.
    53  	Group string `json:"group,omitempty"`
    54  
    55  	// Key carries the original key used during Put().
    56  	Key string `json:"-"`
    57  }