serves

package
v2.24.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTMLError

func HTMLError(w http.ResponseWriter, err error, code int)

func JSONError

func JSONError(w http.ResponseWriter, err error, code int)

func LogError

func LogError(err error, code int)

func Register

func Register(
	store storages.Store,
	router *mux.Router,
	userInfo *url.Userinfo,
	config config.Config,
) error

func RegisterWithHtmlTemplater

func RegisterWithHtmlTemplater(
	store storages.Store,
	router *mux.Router,
	userInfo *url.Userinfo,
	htmlTemplater HtmlTemplater,
	config config.Config,
) error

func SetLocationContext

func SetLocationContext(req *http.Request, location *time.Location)

Types

type ComponentStateData

type ComponentStateData struct {
	Name        string
	Description string
	State       models.ComponentState
}

type HtmlTemplater

type HtmlTemplater interface {
	ExecuteTemplate(wr io.Writer, name string, data interface{}) error
}

type HttpError

type HttpError struct {
	Description string `json:"description"`
	Detail      string `json:"detail"`
	Status      int    `json:"status"`
}

func (HttpError) Error

func (he HttpError) Error() string

type IndexData

type IndexData struct {
	GroupComponentState map[string]models.ComponentState
	ComponentStatesData map[string][]*ComponentStateData
	Timeline            map[string][]models.Incident
	PersistentIncidents []models.Incident
	TimelineDates       []string
	Scheduled           []models.Incident
	BaseInfo            config.BaseInfo
	Timezone            string
	Theme               config.Theme
}

func (*IndexData) ToJsonData added in v2.4.0

func (i *IndexData) ToJsonData() interface{}

type JsonComponent added in v2.4.0

type JsonComponent struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	State       string `json:"state"`
}

type JsonGroup added in v2.4.0

type JsonGroup struct {
	Name       string          `json:"name"`
	Components []JsonComponent `json:"components"`
	State      string          `json:"state"`
}

type JsonIncident added in v2.4.0

type JsonIncident struct {
	GUID           string        `json:"guid"`
	CreatedAt      time.Time     `json:"created_at"`
	UpdatedAt      time.Time     `json:"updated_at"`
	State          string        `json:"state"`
	ComponentState string        `json:"component_state"`
	Components     []string      `json:"components"`
	Messages       []JsonMessage `json:"messages"`
	Metadata       interface{}   `json:"metadata"`
	IsScheduled    bool          `json:"is_scheduled"`
	Persistent     bool          `json:"persistent"`
}

type JsonMessage added in v2.4.0

type JsonMessage struct {
	GUID         string    `json:"guid"`
	IncidentGUID string    `json:"incident_guid"`
	CreatedAt    time.Time `json:"created_at"`
	Title        string    `json:"title"`
	Content      string    `json:"content"`
}

type JsonResponse added in v2.4.0

type JsonResponse struct {
	Groups              []JsonGroup    `json:"groups"`
	PersistentIncidents []JsonIncident `json:"persistent_incidents"`
	Incidents           []JsonIncident `json:"incidents"`
	ScheduledIncidents  []JsonIncident `json:"scheduled"`
	TimeZone            string         `json:"timezone"`
}

type LocationContextType

type LocationContextType int
const (
	LocationContextKey LocationContextType = iota
)

type LocationHandler

type LocationHandler struct {
	// contains filtered or unexported fields
}

func NewLocationHandler

func NewLocationHandler(sessKey string) *LocationHandler

func (LocationHandler) Handler

func (s LocationHandler) Handler(next http.Handler) http.Handler

type MinifyMiddleware

type MinifyMiddleware struct {
	// contains filtered or unexported fields
}

func NewMinifyMiddleware

func NewMinifyMiddleware(next http.Handler) *MinifyMiddleware

func (*MinifyMiddleware) ServeHTTP

func (m *MinifyMiddleware) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Serve

type Serve struct {
	// contains filtered or unexported fields
}

func (*Serve) AddMessage

func (a *Serve) AddMessage(w http.ResponseWriter, req *http.Request)

func (*Serve) AdminAddEditIncident

func (a *Serve) AdminAddEditIncident(w http.ResponseWriter, req *http.Request)

func (*Serve) AdminAddEditIncidentByType

func (a *Serve) AdminAddEditIncidentByType(w http.ResponseWriter, req *http.Request, typ string)

func (*Serve) AdminAddEditMaintenance

func (a *Serve) AdminAddEditMaintenance(w http.ResponseWriter, req *http.Request)

func (*Serve) AdminIncidents

func (a *Serve) AdminIncidents(w http.ResponseWriter, req *http.Request)

func (*Serve) AdminInfo

func (a *Serve) AdminInfo(w http.ResponseWriter, req *http.Request)

func (*Serve) AdminMaintenance

func (a *Serve) AdminMaintenance(w http.ResponseWriter, req *http.Request)

func (*Serve) AdminPersistentIncidents

func (a *Serve) AdminPersistentIncidents(w http.ResponseWriter, req *http.Request)

func (*Serve) Atom

func (a *Serve) Atom(w http.ResponseWriter, req *http.Request)

func (*Serve) BaseInfo

func (a *Serve) BaseInfo() config.BaseInfo

func (*Serve) BaseURL

func (a *Serve) BaseURL() string

func (*Serve) ByDate

func (a *Serve) ByDate(w http.ResponseWriter, req *http.Request)

func (*Serve) CreateIncident

func (a *Serve) CreateIncident(w http.ResponseWriter, req *http.Request)

func (*Serve) Delete

func (a *Serve) Delete(w http.ResponseWriter, req *http.Request)

func (*Serve) DeleteMessage

func (a *Serve) DeleteMessage(w http.ResponseWriter, req *http.Request)

func (*Serve) HealthCheck

func (a *Serve) HealthCheck(w http.ResponseWriter, req *http.Request)

func (*Serve) History

func (a *Serve) History(w http.ResponseWriter, req *http.Request)

func (*Serve) Ical

func (a *Serve) Ical(w http.ResponseWriter, req *http.Request)

func (*Serve) Incident

func (a *Serve) Incident(w http.ResponseWriter, req *http.Request)

func (*Serve) Index

func (a *Serve) Index(w http.ResponseWriter, req *http.Request)

func (*Serve) IsDefaultLocation

func (a *Serve) IsDefaultLocation(req *http.Request) bool

func (*Serve) ListSubscribers

func (a *Serve) ListSubscribers(w http.ResponseWriter, req *http.Request)

func (*Serve) Location

func (a *Serve) Location(req *http.Request) *time.Location

func (*Serve) Notify

func (a *Serve) Notify(w http.ResponseWriter, req *http.Request)

func (*Serve) Persistents

func (a *Serve) Persistents(w http.ResponseWriter, req *http.Request)

func (*Serve) ReadMessage

func (a *Serve) ReadMessage(w http.ResponseWriter, req *http.Request)

func (*Serve) ReadMessages

func (a *Serve) ReadMessages(w http.ResponseWriter, req *http.Request)

func (*Serve) Rss

func (a *Serve) Rss(w http.ResponseWriter, req *http.Request)

func (*Serve) ShowComponents

func (a *Serve) ShowComponents(w http.ResponseWriter, req *http.Request)

func (*Serve) ShowFlagComponentStates

func (a *Serve) ShowFlagComponentStates(w http.ResponseWriter, req *http.Request)

func (*Serve) ShowFlagIncidentStates

func (a *Serve) ShowFlagIncidentStates(w http.ResponseWriter, req *http.Request)

func (*Serve) ShowIncident

func (a *Serve) ShowIncident(w http.ResponseWriter, req *http.Request)

func (*Serve) Statuses added in v2.4.0

func (a *Serve) Statuses(w http.ResponseWriter, req *http.Request)

func (*Serve) SubscribeEmail

func (a *Serve) SubscribeEmail(w http.ResponseWriter, req *http.Request)

func (*Serve) UnsubscribeEmail

func (a *Serve) UnsubscribeEmail(w http.ResponseWriter, req *http.Request)

func (*Serve) Update

func (a *Serve) Update(w http.ResponseWriter, req *http.Request)

func (*Serve) UpdateMessage

func (a *Serve) UpdateMessage(w http.ResponseWriter, req *http.Request)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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