Versions in this module Expand all Collapse all v8 v8.0.2 Oct 4, 2024 GO-2025-4033 GO-2025-4033: Apache Traffic Control has an Inefficient Regular Expression Complexity vulnerability in github.com/apache/trafficcontrol v8.0.2-rc0 Sep 27, 2024 GO-2024-3358 +1 more GO-2024-3358: SQL injection in Apache Traffic Control in github.com/apache/trafficcontrol GO-2025-4033: Apache Traffic Control has an Inefficient Regular Expression Complexity vulnerability in github.com/apache/trafficcontrol v8.0.1 Mar 21, 2024 GO-2024-3358 +1 more GO-2024-3358: SQL injection in Apache Traffic Control in github.com/apache/trafficcontrol GO-2025-4033: Apache Traffic Control has an Inefficient Regular Expression Complexity vulnerability in github.com/apache/trafficcontrol Changes in this version + type APIInfo struct + CancelTx context.CancelFunc + Config *config.Config + IntParams map[string]int + Params map[string]string + ReqID uint64 + Tx *sqlx.Tx + User *auth.CurrentUser + Vault trafficvault.TrafficVault + Version *Version + func (inf *APIInfo) Close() + func (inf *APIInfo) CreateInfluxClient() (*influx.Client, error) + func (inf *APIInfo) IsResourceAuthorizedToCurrentUser(resourceTenantID int) (bool, error) + func (inf *APIInfo) SendMail(to rfc.EmailAddress, msg []byte) (int, error, error) + func (inf APIInfo) CheckPrecondition(query string, args ...interface{}) (int, error, error) + func (inf APIInfo) CreateChangeLog(msg string) + func (inf APIInfo) DecodeBody(ref any) error + func (inf APIInfo) RequestHeaders() http.Header + func (inf APIInfo) SetLastModified(t time.Time) + func (inf APIInfo) UseIMS() bool + func (inf APIInfo) WriteCreatedResponse(resp any, message, path string) (int, error, error) + func (inf APIInfo) WriteNotModifiedResponse(lastModified time.Time) (int, error, error) + func (inf APIInfo) WriteOKResponse(resp any) (int, error, error) + func (inf APIInfo) WriteOKResponseWithSummary(resp any, count uint64) (int, error, error) + func (inf APIInfo) WriteSuccessResponse(resp any, message string) (int, error, error) v8.0.1-rc1 Mar 21, 2024 GO-2024-3358 +1 more GO-2024-3358: SQL injection in Apache Traffic Control in github.com/apache/trafficcontrol GO-2025-4033: Apache Traffic Control has an Inefficient Regular Expression Complexity vulnerability in github.com/apache/trafficcontrol v8.0.1-rc0 Mar 21, 2024 GO-2024-3358 +1 more GO-2024-3358: SQL injection in Apache Traffic Control in github.com/apache/trafficcontrol GO-2025-4033: Apache Traffic Control has an Inefficient Regular Expression Complexity vulnerability in github.com/apache/trafficcontrol v8.0.0 Jan 30, 2024 GO-2024-3358 +1 more GO-2024-3358: SQL injection in Apache Traffic Control in github.com/apache/trafficcontrol GO-2025-4033: Apache Traffic Control has an Inefficient Regular Expression Complexity vulnerability in github.com/apache/trafficcontrol Changes in this version + const APIRespWrittenKey + const ApiChange + const AsyncFailed + const AsyncPending + const AsyncSucceeded + const ConfigContextKey + const Created + const CurrentAsyncEndpoint + const DBContextKey + const Deleted + const MojoCookie + const NilRequestError + const NilTransactionError + const PathParamsKey + const ReqIDContextKey + const ResourceModifiedError + const TrafficVaultContextKey + const Updated + func AddLastModifiedHdr(w http.ResponseWriter, t time.Time) + func AddUserToReq(r *http.Request, u auth.CurrentUser) + func AllParams(req *http.Request, required []string, ints []string) (map[string]string, map[string]int, error, error, int) + func CheckIfUnModified(h http.Header, tx *sqlx.Tx, ID int, tableName string) (error, error, int) + func CheckIfUnModifiedByName(h http.Header, tx *sqlx.Tx, name string, tableName string) (error, error, int) + func CreateChangeLog(level string, action string, i Identifier, user *auth.CurrentUser, tx *sql.Tx) error + func CreateChangeLogBuildMsg(level string, action string, user *auth.CurrentUser, tx *sql.Tx, ...) error + func CreateChangeLogRawErr(level string, msg string, user *auth.CurrentUser, tx *sql.Tx) error + func CreateChangeLogRawTx(level string, msg string, user *auth.CurrentUser, tx *sql.Tx) + func CreateDeprecationAlerts(alternative *string) tc.Alerts + func CreateHandler(creator Creator) http.HandlerFunc + func DefaultSort(readerType *Info, param string) + func DeleteHandler(deleter Deleter) http.HandlerFunc + func DeprecatedCreateHandler(creator Creator, alternative *string) http.HandlerFunc + func DeprecatedDeleteHandler(deleter Deleter, alternative *string) http.HandlerFunc + func DeprecatedReadHandler(reader Reader, alternative *string) http.HandlerFunc + func FormatLastModified(t time.Time) string + func GenericCreate(val GenericCreator) (error, error, int) + func GenericCreateNameBasedID(val GenericCreator) (error, error, int) + func GenericDelete(val GenericDeleter) (error, error, int) + func GenericOptionsDelete(val GenericOptionsDeleter) (error, error, int) + func GenericRead(h http.Header, val GenericReader, useIMS bool) ([]interface{}, error, error, int, *time.Time) + func GenericUpdate(h http.Header, val GenericUpdater) (error, error, int) + func GetAsyncStatus(w http.ResponseWriter, r *http.Request) + func GetCombinedParams(r *http.Request) (map[string]string, error) + func GetConfig(ctx context.Context) (*config.Config, error) + func GetDB(ctx context.Context) (*sqlx.DB, error) + func GetIntKey(s string) (interface{}, error) + func GetLastUpdated(tx *sqlx.Tx, ID int, tableName string) (*time.Time, bool, error) + func GetLastUpdatedByName(tx *sqlx.Tx, name string, tableName string) (*time.Time, bool, error) + func GetPathParams(ctx context.Context) (map[string]string, error) + func GetStringKey(s string) (interface{}, error) + func GetTrafficVault(ctx context.Context) (trafficvault.TrafficVault, error) + func GetUserFromReq(w http.ResponseWriter, r *http.Request, secret string) (auth.CurrentUser, error, error, int) + func GoneHandler(w http.ResponseWriter, r *http.Request) + func HandleDeprecatedErr(w http.ResponseWriter, r *http.Request, tx *sql.Tx, statusCode int, ...) + func HandleErr(w http.ResponseWriter, r *http.Request, tx *sql.Tx, statusCode int, ...) + func HandleErrOptionalDeprecation(w http.ResponseWriter, r *http.Request, tx *sql.Tx, statusCode int, ...) + func InsertAsyncStatus(tx *sql.Tx, message string) (int, int, error, error) + func IntParams(params map[string]string, intParamNames []string) (map[string]int, error) + func IsBool(s string) error + func IsInt(s string) error + func IsUnmodified(h http.Header, lastUpdated time.Time) bool + func LogErr(r *http.Request, errCode int, userErr error, sysErr error) error + func LoginAuth(identity, username, password, host string) smtp.Auth + func ParamsHaveRequired(params map[string]string, required []string) error + func Parse(r io.Reader, tx *sql.Tx, v ParseValidator) error + func ParseDBError(ierr error) (error, error, int) + func ReadHandler(reader Reader) http.HandlerFunc + func RespWriter(w http.ResponseWriter, r *http.Request, tx *sql.Tx) func(v interface{}, err error) + func RespWriterVals(w http.ResponseWriter, r *http.Request, tx *sql.Tx, ...) func(v interface{}, err error) + func SendEmailFromTemplate(config config.Config, header string, data interface{}, templateFile string, ...) (int, error, error) + func SendMail(to rfc.EmailAddress, msg []byte, cfg *config.Config) (int, error, error) + func SetLastModifiedHeader(r *http.Request, useIMS bool) bool + func StripParamJSON(params map[string]string) map[string]string + func TryIfModifiedSinceQuery(val GenericReader, h http.Header, where string, orderBy string, ...) (bool, time.Time) + func UpdateAsyncStatus(db *sqlx.DB, newStatus string, newMessage string, asyncStatusId int, ...) error + func UpdateHandler(updater Updater) http.HandlerFunc + func Wrap(h Handler, requiredParams, intParams []string) http.HandlerFunc + func WriteAlerts(w http.ResponseWriter, r *http.Request, code int, alerts tc.Alerts) + func WriteAlertsObj(w http.ResponseWriter, r *http.Request, code int, alerts tc.Alerts, ...) + func WriteAndLogErr(w http.ResponseWriter, r *http.Request, bts []byte) + func WriteIMSHitResp(w http.ResponseWriter, r *http.Request, t time.Time) + func WriteNotModifiedResponse(t time.Time, w http.ResponseWriter, r *http.Request) + func WriteResp(w http.ResponseWriter, r *http.Request, v interface{}) + func WriteRespAlert(w http.ResponseWriter, r *http.Request, level tc.AlertLevel, msg string) + func WriteRespAlertNotFound(w http.ResponseWriter, r *http.Request) + func WriteRespAlertObj(w http.ResponseWriter, r *http.Request, level tc.AlertLevel, msg string, ...) + func WriteRespRaw(w http.ResponseWriter, r *http.Request, v interface{}) + func WriteRespVals(w http.ResponseWriter, r *http.Request, v interface{}, ...) + func WriteRespWithSummary(w http.ResponseWriter, r *http.Request, v interface{}, count uint64) + type APIInfoImpl struct + ReqInfo *Info + func (val *APIInfoImpl) SetInfo(inf *Info) + func (val APIInfoImpl) APIInfo() *Info + type APIInfoer interface + APIInfo func() *Info + SetInfo func(*Info) + type APIResponse struct + Response interface{} + type APIResponseWithSummary struct + Response interface{} + Summary struct{ ... } + type AlertsResponse interface + GetAlerts func() tc.Alerts + type CRUDer interface + Create func() (error, error, int) + Delete func() (error, error, int) + Read func(h http.Header, useIMS bool) ([]interface{}, error, error, int, *time.Time) + Update func(http.Header) (error, error, int) + type ChangeLog struct + ID int + LastUpdated tc.TimeNoMod + Level string + Message string + TMUser int + TicketNum string + type ChangeLogger interface + ChangeLogMessage func(action string) (string, error) + type Creator interface + Create func() (error, error, int) + type Deleter interface + Delete func() (error, error, int) + type Errors interface + Code func() int + Error func() string + SetCode func(int) + SetSystemError func(err error) + SetSystemErrorString func(err string) + SetSystemErrorf func(format string, args ...any) + SetUserError func(err error) + SetUserErrorString func(err string) + SetUserErrorf func(format string, args ...any) + String func() string + SystemError func() error + UserError func() error + func NewErrors(code int, userError, systemError error) Errors + func NewResourceModifiedError() Errors + func NewSystemError(err error) Errors + func NewSystemErrorString(err string) Errors + func NewSystemErrorf(format string, args ...any) Errors + func NewUserError(err error) Errors + func NewUserErrorString(err string) Errors + func NewUserErrorf(format string, args ...any) Errors + type Errs struct + func (e *Errs) Code() int + func (e *Errs) Error() string + func (e *Errs) SetCode(code int) + func (e *Errs) SetSystemError(err error) + func (e *Errs) SetSystemErrorString(err string) + func (e *Errs) SetSystemErrorf(format string, args ...any) + func (e *Errs) SetUserError(err error) + func (e *Errs) SetUserErrorString(err string) + func (e *Errs) SetUserErrorf(format string, args ...any) + func (e *Errs) String() string + func (e *Errs) SystemError() error + func (e *Errs) UserError() error + type GenericCreator interface + APIInfo func() *Info + GetType func() string + InsertQuery func() string + SetKeys func(map[string]interface{}) + SetLastUpdated func(tc.TimeNoMod) + type GenericDeleter interface + APIInfo func() *Info + DeleteQuery func() string + GetType func() string + type GenericOptionsDeleter interface + APIInfo func() *Info + DeleteKeyOptions func() map[string]dbhelpers.WhereColumnInfo + DeleteQueryBase func() string + GetType func() string + type GenericReader interface + APIInfo func() *Info + GetType func() string + NewReadObj func() interface{} + ParamColumns func() map[string]dbhelpers.WhereColumnInfo + SelectMaxLastUpdatedQuery func(where string, orderBy string, pagination string, tableName string) string + SelectQuery func() string + type GenericUpdater interface + APIInfo func() *Info + GetLastUpdated func() (*time.Time, bool, error) + GetType func() string + SetLastUpdated func(tc.TimeNoMod) + UpdateQuery func() string + type Handler = func(*Info) (int, error, error) + type Identifier interface + GetAuditName func() string + GetKeyFieldsInfo func() []KeyFieldInfo + GetKeys func() (map[string]interface{}, bool) + GetType func() string + SetKeys func(map[string]interface{}) + type Info struct + CancelTx context.CancelFunc + Config *config.Config + IntParams map[string]int + Params map[string]string + ReqID uint64 + Tx *sqlx.Tx + User *auth.CurrentUser + Vault trafficvault.TrafficVault + Version *Version + func NewInfo(r *http.Request, requiredParams []string, intParamNames []string) (*Info, error, error, int) + func (inf *Info) Close() + func (inf *Info) CreateInfluxClient() (*influx.Client, error) + func (inf *Info) IsResourceAuthorizedToCurrentUser(resourceTenantID int) (bool, error) + func (inf *Info) SendMail(to rfc.EmailAddress, msg []byte) (int, error, error) + func (inf Info) CheckPrecondition(query string, args ...interface{}) (int, error, error) + func (inf Info) CreateChangeLog(msg string) + func (inf Info) DecodeBody(ref any) error + func (inf Info) DefaultSort(param string) + func (inf Info) RequestHeaders() http.Header + func (inf Info) SetLastModified(t time.Time) + func (inf Info) UseIMS() bool + func (inf Info) WriteCreatedResponse(resp any, message, path string) (int, error, error) + func (inf Info) WriteNotModifiedResponse(lastModified time.Time) (int, error, error) + func (inf Info) WriteOKResponse(resp any) (int, error, error) + func (inf Info) WriteOKResponseWithSummary(resp any, count uint64) (int, error, error) + func (inf Info) WriteSuccessResponse(resp any, message string) (int, error, error) + type KeyFieldInfo struct + Field string + Func func(string) (interface{}, error) + type MultipleCreator interface + AllowMultipleCreates func() bool + type OptionsDeleter interface + DeleteKeyOptions func() map[string]dbhelpers.WhereColumnInfo + OptionsDelete func() (error, error, int) + type ParseValidator interface + Validate func(tx *sql.Tx) error + type Reader interface + Read func(h http.Header, useIMS bool) ([]interface{}, error, error, int, *time.Time) + type Tenantable interface + IsTenantAuthorized func(user *auth.CurrentUser) (bool, error) + type Updater interface + Update func(h http.Header) (error, error, int) + type Validator interface + Validate func() (error, error) + type Version struct + Major uint64 + Minor uint64 + func GetRequestedAPIVersion(path string) *Version + func (v *Version) GreaterThanOrEqualTo(otherVersion *Version) bool + func (v *Version) LessThan(otherVersion *Version) bool + func (v *Version) String() string v8.0.0-rc6 Jan 24, 2024 GO-2025-4033 GO-2025-4033: Apache Traffic Control has an Inefficient Regular Expression Complexity vulnerability in github.com/apache/trafficcontrol v8.0.0-rc5 Jan 17, 2024 GO-2025-4033 GO-2025-4033: Apache Traffic Control has an Inefficient Regular Expression Complexity vulnerability in github.com/apache/trafficcontrol v8.0.0-rc4 Oct 23, 2023 GO-2025-4033 GO-2025-4033: Apache Traffic Control has an Inefficient Regular Expression Complexity vulnerability in github.com/apache/trafficcontrol v8.0.0-rc3 Oct 3, 2023 GO-2025-4033 GO-2025-4033: Apache Traffic Control has an Inefficient Regular Expression Complexity vulnerability in github.com/apache/trafficcontrol v8.0.0-rc2 Sep 25, 2023 GO-2025-4033 GO-2025-4033: Apache Traffic Control has an Inefficient Regular Expression Complexity vulnerability in github.com/apache/trafficcontrol v8.0.0-rc1 Sep 22, 2023 GO-2025-4033 GO-2025-4033: Apache Traffic Control has an Inefficient Regular Expression Complexity vulnerability in github.com/apache/trafficcontrol Other modules containing this package github.com/apache/trafficcontrol