Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToProxyServer ¶
func ToProxyServer(s ServerDTO) (domain.ProxyServer, error)
ToProxyServer converts DTO object to proxyServer domain object
Types ¶
type APIResponse ¶
type APIResponse struct { Data interface{} `json:"data"` Success bool `json:"success"` }
APIResponse is common response structure for all responses
type ReplacementDTO ¶
ReplacementDTO is DTO for replacements
type RequestDTO ¶
type RequestDTO struct { ID string `json:"id"` Service string `json:"service"` RequestTime time.Time `json:"request_time"` RequestSize int64 `json:"request_size"` ResponseTime time.Time `json:"response_time"` ResponseSize int64 `json:"response_size"` Request string `json:"request_body,omitempty"` Response string `json:"response_body,omitempty"` }
RequestDTO is DTO for request
func RequestToDTO ¶
func RequestToDTO(req domain.Request) RequestDTO
RequestToDTO converts domain object to DTO without request/response body elements
func RequestToFullDTO ¶
func RequestToFullDTO(req domain.Request) RequestDTO
RequestToFullDTO converts domain object to DTO with all fields included
func RequestsToDTO ¶
func RequestsToDTO(reqs []domain.Request) []RequestDTO
RequestsToDTO converts slice of request to DTOs
type RuleDTO ¶
type RuleDTO struct { ID int64 `json:"id"` Server string `json:"server"` Service string `json:"service"` Priority int64 `json:"priority"` MatcherRemoteAddr []string `json:"matcher_remote_addr"` MatcherRegex []string `json:"matcher_regexes"` RequestReplacements []ReplacementDTO `json:"request_replacements"` ResponseReplacements []ReplacementDTO `json:"response_replacements"` IsReadOnly bool `json:"read_only"` }
RuleDTO is DTO for rule
func RulesToDTO ¶
RulesToDTO converts slice of rules to DTOs
type ServerDTO ¶
type ServerDTO struct { ID int64 `json:"id"` Name string `json:"name"` Address string `json:"address"` IsReadOnly bool `json:"read_only"` TLS *TLSDTO `json:"tls,omitempty"` }
ServerDTO is DTO for proxyServer
func ProxyServerToDTO ¶
func ProxyServerToDTO(s domain.ProxyServer) ServerDTO
ProxyServerToDTO converts proxy server to DTO
func ProxyServersToDTO ¶
func ProxyServersToDTO(rules []domain.ProxyServer) []ServerDTO
ProxyServersToDTO converts slice of servers to DTOs
Click to show internal directories.
Click to hide internal directories.