database

package
v0.0.0-...-9e3aff1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTables

func CheckTables()

func Close

func Close()

func GetDbCli

func GetDbCli() *sql.DB

func GetDomainList

func GetDomainList(sent, dateMode bool, dateInterval time.Duration) (domainIds []int, err error)

func GetRangeDate

func GetRangeDate(request *Requests, sent, dateMode bool, dateInterval time.Duration) (dateMin, dateMax int, err error)

func GetRequestList

func GetRequestList(domain *Domain, sent, dateMode bool, dateInterval time.Duration) (requestIds []int, err error)

func MakeDate

func MakeDate(dateDay bool, dateInterval time.Duration) (dateFrom, dateTo int, err error)

Types

type Domain

type Domain struct {
	Generic
}

func GetDomain

func GetDomain(Id int) (*Domain, error)

func NewDomain

func NewDomain(Name string) *Domain

type FieldList

type FieldList map[string]string

Copyright 2018 Nicolas JUHEL

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

func (FieldList) Join

func (fld FieldList) Join() string

type Generic

type Generic struct {
	Id   int
	Name string
	Date time.Time
	// contains filtered or unexported fields
}

func (Generic) CheckTable

func (gen Generic) CheckTable() error

func (*Generic) Delete

func (gen *Generic) Delete() error

func (*Generic) Load

func (gen *Generic) Load() error

func (*Generic) Save

func (gen *Generic) Save() error

func (*Generic) Update

func (gen *Generic) Update() error

type IndexList

type IndexList map[string]map[string]string

func (IndexList) Join

func (fld IndexList) Join() string

type IpAddr

type IpAddr struct {
	Generic
}

func GetIpAddr

func GetIpAddr(Id int) (*IpAddr, error)

func NewIpAddr

func NewIpAddr(Name string) *IpAddr

type Messages

type Messages struct {
	Generic

	Id           int
	Date         time.Time
	JobId        string
	Reporter     *Reporters
	Ip           *IpAddr
	Policy       int
	Disp         int
	FromDomain   *Domain
	EnvDomain    *Domain
	PolicyDomain *Domain
	SigCount     int
	SPF          int
	AlignSPF     int
	AlignDKIM    int
	Request      *Requests
	Sent         bool
}

func GetAllMessages

func GetAllMessages(request *Requests, sent, dateMode bool, dateInterval time.Duration) (lst []*Messages, err error)

func GetMessages

func GetMessages(Id int) (*Messages, error)

func NewMessages

func NewMessages(JobId string) *Messages

func (*Messages) GetAlignDKIM

func (obj *Messages) GetAlignDKIM() string

func (*Messages) GetAlignSPF

func (obj *Messages) GetAlignSPF() string

func (*Messages) GetDisp

func (obj *Messages) GetDisp() string

func (*Messages) GetDkimReport

func (obj *Messages) GetDkimReport() ([]report.ReportDKIM, error)

func (Messages) GetReport

func (obj Messages) GetReport() (report.ReportRecord, error)

func (*Messages) GetSPF

func (obj *Messages) GetSPF() string

func (*Messages) GetSignatures

func (obj *Messages) GetSignatures() ([]*Signatures, error)

func (*Messages) Load

func (obj *Messages) Load() error

func (*Messages) Save

func (obj *Messages) Save() error

func (*Messages) SetDate

func (obj *Messages) SetDate(received string) error

func (*Messages) SetEnvDomain

func (obj *Messages) SetEnvDomain(envDomain string) error

func (*Messages) SetFromDomain

func (obj *Messages) SetFromDomain(fromDomain string) error

func (*Messages) SetIpAddr

func (obj *Messages) SetIpAddr(ipaddr string) error

func (*Messages) SetPolicyDomain

func (obj *Messages) SetPolicyDomain(polDomain string) error

func (*Messages) SetReporter

func (obj *Messages) SetReporter(reporter string) error

func (*Messages) SetSent

func (obj *Messages) SetSent(Sent bool) error

func (*Messages) Update

func (obj *Messages) Update() error

type Reporters

type Reporters struct {
	Generic
}

func GetReporters

func GetReporters(Id int) (*Reporters, error)

func NewReporters

func NewReporters(Name string) *Reporters

type Requests

type Requests struct {
	Generic

	Domain  *Domain
	Repuri  string
	Pct     int
	Policy  int
	Spolicy int
	ASPF    int
	ADKIM   int
	Locked  bool
}

func GetRequests

func GetRequests(Id int) (*Requests, error)

func NewRequests

func NewRequests(domain *Domain) *Requests

func (Requests) GetADKIM

func (obj Requests) GetADKIM() string

func (Requests) GetASPF

func (obj Requests) GetASPF() string

func (Requests) GetPolicy

func (obj Requests) GetPolicy() string

func (Requests) GetSPolicy

func (obj Requests) GetSPolicy() string

func (Requests) IsLocked

func (obj Requests) IsLocked() bool

func (*Requests) Load

func (obj *Requests) Load() error

func (*Requests) Save

func (obj *Requests) Save() error

func (*Requests) SendReport

func (obj *Requests) SendReport(org, email string, upd, sent bool, dateMode bool, dateInterval time.Duration) error

func (*Requests) SetDate

func (obj *Requests) SetDate(received string) error

func (*Requests) SetDateTime

func (obj *Requests) SetDateTime(received time.Time) error

func (*Requests) SetLocked

func (obj *Requests) SetLocked() error

func (*Requests) SetUnLocked

func (obj *Requests) SetUnLocked() error

func (*Requests) Update

func (obj *Requests) Update() error

type Signatures

type Signatures struct {
	Generic

	Id      int
	Message *Messages
	Domain  *Domain
	Pass    int
	Error   bool
}

func GetAllSignatures

func GetAllSignatures(Message *Messages) ([]*Signatures, error)

func GetSignatures

func GetSignatures(Id int) (*Signatures, error)

func NewSignatures

func NewSignatures(Message *Messages) *Signatures

func (*Signatures) Delete

func (obj *Signatures) Delete() error

func (*Signatures) DeleteFromMessage

func (obj *Signatures) DeleteFromMessage() error

func (Signatures) GetMessage

func (obj Signatures) GetMessage() *Messages

func (Signatures) GetPass

func (obj Signatures) GetPass() string

func (Signatures) GetReport

func (obj Signatures) GetReport() report.ReportDKIM

func (*Signatures) Load

func (obj *Signatures) Load() error

func (*Signatures) Save

func (obj *Signatures) Save() error

func (*Signatures) Update

func (obj *Signatures) Update() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL