Documentation
¶
Index ¶
- func AddNewProgramIfNotExist(db *gorm.DB, programName string, config json.RawMessage, ...) (*int, error)
- func DeleteProgramWithProgramName(db *gorm.DB, programName string) error
- func GetAllLiveSubdomainWithScopeName(db *gorm.DB, scope string) ([]string, error)
- func GetAllSubdomainWithScopeName(db *gorm.DB, scope string) ([]string, error)
- func InsertOrUpdateProgram(db *gorm.DB, program *Program) error
- func UpsertHttp(db *gorm.DB, http Http)
- func UpsertLiveSubdomain(db *gorm.DB, domain, subdomain string, ips []string, tag string) error
- func UpsertSubdomain(db *gorm.DB, programName string, subDomain string, provider string) error
- type BaseModel
- type CreateHuntRequest
- type CreateUpdateProgramRequest
- type CreateUpdateSubDomainRequest
- type Http
- type Hunt
- type HuntResponse
- type LiveSubdomain
- type MapField
- type Program
- type ProgramResponse
- type StringArray
- type SubDomainResponse
- type Subdomain
- type UpdateHuntRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddNewProgramIfNotExist ¶ added in v0.0.203
func DeleteProgramWithProgramName ¶ added in v0.0.207
DeleteProgramWithProgramName deletes a Program by its ProgramName.
func GetAllLiveSubdomainWithScopeName ¶ added in v0.0.207
func GetAllSubdomainWithScopeName ¶ added in v0.0.205
func InsertOrUpdateProgram ¶ added in v0.0.203
insertOrUpdateProgram inserts a new record or updates an existing one based on the ProgramName.
func UpsertHttp ¶ added in v0.0.207
UpsertHttp performs an upsert (insert or update) operation on the Http model
func UpsertLiveSubdomain ¶ added in v0.0.205
UpsertLives inserts or updates a live subdomain entry in the database.
Types ¶
type BaseModel ¶
type CreateHuntRequest ¶
type CreateHuntRequest struct {
Name string `json:"name" binding:"required,min:3,max:100"`
}
type CreateUpdateProgramRequest ¶
type CreateUpdateProgramRequest struct { ProgramName string `json:"name" binding:"required,min:3,max:100"` Config json.RawMessage `json:"config"` Scopes []string `json:"scopes"` Otoscopes []string `json:"otoscopes"` }
type Http ¶ added in v0.0.205
type Http struct { BaseModel ProgramName string `gorm:"type:text;not null;uniqueIndex:idx_program_subdomain"` SubDomain string `gorm:"type:text;not null;uniqueIndex:idx_program_subdomain"` Scope string `gorm:"type:text;not null"` IPs StringArray `gorm:"type:text[]"` Tech StringArray `gorm:"type:text[]"` Title string `gorm:"type:text"` StatusCode string `gorm:"type:text"` Headers MapField `gorm:"type:jsonb"` URL string `gorm:"type:text"` FinalURL string `gorm:"type:text"` Favicon string `gorm:"type:text"` }
Http represents the HTTP model
type HuntResponse ¶
type LiveSubdomain ¶ added in v0.0.205
type LiveSubdomain struct { BaseModel ProgramName string `gorm:"type:text;not null;uniqueIndex:idx_program_subdomain"` // Composite unique index Subdomain string `gorm:"type:text;not null;uniqueIndex:idx_program_subdomain"` // Same unique index name Scope string `gorm:"type:text;not null"` IPs StringArray `gorm:"type:text[]"` Tag string `gorm:"type:text"` }
LiveSubdomains represents the live subdomains model
func GetAllLiveSubdomainWithScope ¶ added in v0.0.205
func GetAllLiveSubdomainWithScope(db *gorm.DB, scope string) ([]LiveSubdomain, error)
GetAllLiveSubdomainWithScope fetches all subdomains associated with a given scope
func GetAllLiveSubdomainWithScopeAndDomain ¶ added in v0.0.207
func GetAllLiveSubdomainWithScopeAndDomain(db *gorm.DB, scope string, domain string) ([]LiveSubdomain, error)
GetAllLiveSubdomainWithScope fetches all subdomains associated with a given scope
func GetLiveSubdomain ¶ added in v0.0.207
func GetLiveSubdomain(db *gorm.DB, subdomain string) (*LiveSubdomain, error)
GetLiveSubdomain fetches a LiveSubdomain record by subdomain.
type MapField ¶ added in v0.0.205
type MapField map[string]interface{}
MapField type to handle JSONB fields in PostgreSQL
type Program ¶
type Program struct { BaseModel ProgramName string `gorm:"type:text;not null;uniqueIndex"` // Unique and indexed Config json.RawMessage `gorm:"type:jsonb;default:null"` // Dictionary field, nullable Scopes pq.StringArray `gorm:"type:text[]"` // Correctly handle PostgreSQL text[] Otoscopes pq.StringArray `gorm:"type:text[]"` // Correctly handle PostgreSQL text[] }
Import pq package for PostgreSQL support
func FindDomainWithProgramName ¶ added in v0.0.203
FindDomainWithProgramName queries a Program by its ProgramName
func GetAllPrograms ¶ added in v0.0.204
getAllPrograms retrieves all programs from the database
func GetProgramByProgramName ¶ added in v0.0.207
GetProgramByProgramName fetches a Program by its ProgramName
type ProgramResponse ¶
type StringArray ¶ added in v0.0.203
type StringArray []string
StringArray custom type for PostgreSQL text[]
func (*StringArray) Scan ¶ added in v0.0.203
func (sa *StringArray) Scan(value interface{}) error
Scan implements the sql.Scanner interface for StringArray
type SubDomainResponse ¶
type Subdomain ¶
type Subdomain struct { BaseModel ProgramName string `gorm:"type:text;not null;uniqueIndex:idx_program_subdomain"` // Named unique index SubDomain string `gorm:"type:text;not null;uniqueIndex:idx_program_subdomain"` // Same unique index name Scope string `gorm:"type:text; ` Providers StringArray `gorm:"type:text[]"` }
/////////////////////////////////////////////////////////////
func FindSubdomainByProgramAndSubdomain ¶ added in v0.0.203
func GetAllSubdomainWithScope ¶ added in v0.0.205
GetAllSubdomainWithScope fetches all subdomains associated with a given scope
type UpdateHuntRequest ¶
type UpdateHuntRequest struct {
Name string `json:"name" binding:"required,min:3,max:100"`
}