Package domaininfo implements a domain information database, to keep track of things we know about a particular domain.



    This section is empty.


    View Source
    var (
    	SecLevel_name = map[int32]string{
    		0: "PLAIN",
    		1: "TLS_CLIENT",
    		2: "TLS_INSECURE",
    		3: "TLS_SECURE",
    	SecLevel_value = map[string]int32{
    		"PLAIN":        0,
    		"TLS_CLIENT":   1,
    		"TLS_INSECURE": 2,
    		"TLS_SECURE":   3,

      Enum value maps for SecLevel.

      View Source
      var File_domaininfo_proto protoreflect.FileDescriptor


      This section is empty.


      type DB

      type DB struct {
      	// contains filtered or unexported fields

        DB represents the persistent domain information database.

        func New

        func New(dir string) (*DB, error)

          New opens a domain information database on the given dir, creating it if necessary. The returned database will not be loaded.

          func (*DB) IncomingSecLevel

          func (db *DB) IncomingSecLevel(domain string, level SecLevel) bool

            IncomingSecLevel checks an incoming security level for the domain. Returns true if allowed, false otherwise.

            func (*DB) OutgoingSecLevel

            func (db *DB) OutgoingSecLevel(domain string, level SecLevel) bool

              OutgoingSecLevel checks an incoming security level for the domain. Returns true if allowed, false otherwise.

              func (*DB) Reload

              func (db *DB) Reload() error

                Reload the database from disk.

                type Domain

                type Domain struct {
                	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
                	// Security level for mail coming from this domain (they send to us).
                	IncomingSecLevel SecLevel `` /* 137-byte string literal not displayed */
                	// Security level for mail going to this domain (we send to them).
                	OutgoingSecLevel SecLevel `` /* 137-byte string literal not displayed */
                	// contains filtered or unexported fields

                func (*Domain) Descriptor

                func (*Domain) Descriptor() ([]byte, []int)

                  Deprecated: Use Domain.ProtoReflect.Descriptor instead.

                  func (*Domain) GetIncomingSecLevel

                  func (x *Domain) GetIncomingSecLevel() SecLevel

                  func (*Domain) GetName

                  func (x *Domain) GetName() string

                  func (*Domain) GetOutgoingSecLevel

                  func (x *Domain) GetOutgoingSecLevel() SecLevel

                  func (*Domain) ProtoMessage

                  func (*Domain) ProtoMessage()

                  func (*Domain) ProtoReflect

                  func (x *Domain) ProtoReflect() protoreflect.Message

                  func (*Domain) Reset

                  func (x *Domain) Reset()

                  func (*Domain) String

                  func (x *Domain) String() string

                  type SecLevel

                  type SecLevel int32
                  const (
                  	// Does not do TLS.
                  	SecLevel_PLAIN SecLevel = 0
                  	// TLS client connection (no certificate validation).
                  	SecLevel_TLS_CLIENT SecLevel = 1
                  	// TLS, but with invalid certificates.
                  	SecLevel_TLS_INSECURE SecLevel = 2
                  	// TLS, with valid certificates.
                  	SecLevel_TLS_SECURE SecLevel = 3

                  func (SecLevel) Descriptor

                  func (SecLevel) Descriptor() protoreflect.EnumDescriptor

                  func (SecLevel) Enum

                  func (x SecLevel) Enum() *SecLevel

                  func (SecLevel) EnumDescriptor

                  func (SecLevel) EnumDescriptor() ([]byte, []int)

                    Deprecated: Use SecLevel.Descriptor instead.

                    func (SecLevel) Number

                    func (x SecLevel) Number() protoreflect.EnumNumber

                    func (SecLevel) String

                    func (x SecLevel) String() string

                    func (SecLevel) Type