Documentation
¶
Index ¶
- func EnsurePeriod(start time.Time, end time.Time) error
- func FilterDeletedEndpoints(endpoints []datastore.Endpoint) []datastore.Endpoint
- func GetAppIDFromContext(r *http.Request) string
- func GetApplicationEndpointFromContext(ctx context.Context) *datastore.Endpoint
- func GetApplicationFromContext(ctx context.Context) *datastore.Application
- func GetApplicationsFromContext(ctx context.Context) *[]datastore.Application
- func GetAuthFromRequest(r *http.Request) (*auth.Credential, error)
- func GetAuthUserFromContext(ctx context.Context) *auth.AuthenticatedUser
- func GetDeliveryAttemptFromContext(ctx context.Context) *datastore.DeliveryAttempt
- func GetDeliveryAttemptsFromContext(ctx context.Context) *[]datastore.DeliveryAttempt
- func GetEventDeliveryFromContext(ctx context.Context) *datastore.EventDelivery
- func GetEventFromContext(ctx context.Context) *datastore.Event
- func GetGroupFromContext(ctx context.Context) *datastore.Group
- func GetHostFromContext(ctx context.Context) string
- func GetOrganisationFromContext(ctx context.Context) *datastore.Organisation
- func GetOrganisationMemberFromContext(ctx context.Context) *datastore.OrganisationMember
- func GetPageableFromContext(ctx context.Context) datastore.Pageable
- func GetPaginationDataFromContext(ctx context.Context) *datastore.PaginationData
- func GetUserFromContext(ctx context.Context) *datastore.User
- func ParseEndpointFromBody(r *http.Request) (models.Endpoint, error)
- func SetDeliveryAttemptsInContext(ctx context.Context, attempts *[]datastore.DeliveryAttempt) context.Context
- func ShouldAuthRoute(r *http.Request) bool
- type AuthorizedLogin
- type CreateMiddleware
- type Middleware
- func (m *Middleware) ComputeDashboardMessages(ctx context.Context, orgId string, searchParams datastore.SearchParams, ...) (uint64, []datastore.EventInterval, error)
- func (m *Middleware) GetDefaultGroup(r *http.Request, groupRepo datastore.GroupRepository) (*datastore.Group, error)
- func (m *Middleware) InstrumentPath(path string) func(http.Handler) http.Handler
- func (m *Middleware) InstrumentRequests() func(next http.Handler) http.Handler
- func (m *Middleware) JsonResponse(next http.Handler) http.Handler
- func (m *Middleware) LogHttpRequest() func(next http.Handler) http.Handler
- func (m *Middleware) Pagination(next http.Handler) http.Handler
- func (m *Middleware) RateLimitByGroupID() func(next http.Handler) http.Handler
- func (m *Middleware) RateLimitByGroupWithParams(requestLimit int, windowLength time.Duration) func(next http.Handler) http.Handler
- func (m *Middleware) RequireApp() func(next http.Handler) http.Handler
- func (m *Middleware) RequireAppEndpoint() func(next http.Handler) http.Handler
- func (m *Middleware) RequireAppID() func(next http.Handler) http.Handler
- func (m *Middleware) RequireAppPortalApplication() func(next http.Handler) http.Handler
- func (m *Middleware) RequireAppPortalPermission(role auth.RoleType) func(next http.Handler) http.Handler
- func (m *Middleware) RequireAuth() func(next http.Handler) http.Handler
- func (m *Middleware) RequireAuthUserMetadata() func(next http.Handler) http.Handler
- func (m *Middleware) RequireAuthorizedUser() func(next http.Handler) http.Handler
- func (m *Middleware) RequireBaseUrl() func(next http.Handler) http.Handler
- func (m *Middleware) RequireDeliveryAttempt() func(next http.Handler) http.Handler
- func (m *Middleware) RequireEvent() func(next http.Handler) http.Handler
- func (m *Middleware) RequireEventDelivery() func(next http.Handler) http.Handler
- func (m *Middleware) RequireGroup() func(next http.Handler) http.Handler
- func (m *Middleware) RequireOrganisation() func(next http.Handler) http.Handler
- func (m *Middleware) RequireOrganisationGroupMember() func(next http.Handler) http.Handler
- func (m *Middleware) RequireOrganisationMemberRole(roleType auth.RoleType) func(next http.Handler) http.Handler
- func (m *Middleware) RequireOrganisationMembership() func(next http.Handler) http.Handler
- func (m *Middleware) RequirePermission(role auth.RoleType) func(next http.Handler) http.Handler
- func (m *Middleware) SetupCORS(next http.Handler) http.Handler
- func (m *Middleware) WriteRequestIDHeader(next http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterDeletedEndpoints ¶
func GetAppIDFromContext ¶ added in v0.6.7
func GetApplicationFromContext ¶
func GetApplicationFromContext(ctx context.Context) *datastore.Application
func GetApplicationsFromContext ¶
func GetApplicationsFromContext(ctx context.Context) *[]datastore.Application
func GetAuthFromRequest ¶
func GetAuthFromRequest(r *http.Request) (*auth.Credential, error)
func GetAuthUserFromContext ¶
func GetAuthUserFromContext(ctx context.Context) *auth.AuthenticatedUser
func GetDeliveryAttemptFromContext ¶
func GetDeliveryAttemptFromContext(ctx context.Context) *datastore.DeliveryAttempt
func GetDeliveryAttemptsFromContext ¶
func GetDeliveryAttemptsFromContext(ctx context.Context) *[]datastore.DeliveryAttempt
func GetEventDeliveryFromContext ¶
func GetEventDeliveryFromContext(ctx context.Context) *datastore.EventDelivery
func GetHostFromContext ¶
func GetOrganisationFromContext ¶
func GetOrganisationFromContext(ctx context.Context) *datastore.Organisation
func GetOrganisationMemberFromContext ¶
func GetOrganisationMemberFromContext(ctx context.Context) *datastore.OrganisationMember
func GetPaginationDataFromContext ¶
func GetPaginationDataFromContext(ctx context.Context) *datastore.PaginationData
func ShouldAuthRoute ¶
Types ¶
type AuthorizedLogin ¶
type AuthorizedLogin struct {
Username string `json:"username,omitempty"`
Token string `json:"token"`
ExpiryTime time.Time `json:"expiry_time"`
}
func GetAuthLoginFromContext ¶
func GetAuthLoginFromContext(ctx context.Context) *AuthorizedLogin
type CreateMiddleware ¶
type CreateMiddleware struct {
EventRepo datastore.EventRepository
EventDeliveryRepo datastore.EventDeliveryRepository
AppRepo datastore.ApplicationRepository
GroupRepo datastore.GroupRepository
ApiKeyRepo datastore.APIKeyRepository
SubRepo datastore.SubscriptionRepository
SourceRepo datastore.SourceRepository
OrgRepo datastore.OrganisationRepository
OrgMemberRepo datastore.OrganisationMemberRepository
OrgInviteRepo datastore.OrganisationInviteRepository
UserRepo datastore.UserRepository
ConfigRepo datastore.ConfigurationRepository
Cache cache.Cache
Logger logger.Logger
Limiter limiter.RateLimiter
Tracer tracer.Tracer
}
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
func NewMiddleware ¶
func NewMiddleware(cs *CreateMiddleware) *Middleware
func (*Middleware) ComputeDashboardMessages ¶
func (m *Middleware) ComputeDashboardMessages(ctx context.Context, orgId string, searchParams datastore.SearchParams, period datastore.Period) (uint64, []datastore.EventInterval, error)
func (*Middleware) GetDefaultGroup ¶
func (m *Middleware) GetDefaultGroup(r *http.Request, groupRepo datastore.GroupRepository) (*datastore.Group, error)
func (*Middleware) InstrumentPath ¶
func (*Middleware) InstrumentRequests ¶
func (m *Middleware) InstrumentRequests() func(next http.Handler) http.Handler
func (*Middleware) JsonResponse ¶
func (m *Middleware) JsonResponse(next http.Handler) http.Handler
func (*Middleware) LogHttpRequest ¶
func (m *Middleware) LogHttpRequest() func(next http.Handler) http.Handler
func (*Middleware) Pagination ¶
func (m *Middleware) Pagination(next http.Handler) http.Handler
func (*Middleware) RateLimitByGroupID ¶
func (m *Middleware) RateLimitByGroupID() func(next http.Handler) http.Handler
func (*Middleware) RateLimitByGroupWithParams ¶
func (*Middleware) RequireApp ¶
func (m *Middleware) RequireApp() func(next http.Handler) http.Handler
func (*Middleware) RequireAppEndpoint ¶
func (m *Middleware) RequireAppEndpoint() func(next http.Handler) http.Handler
func (*Middleware) RequireAppID ¶
func (m *Middleware) RequireAppID() func(next http.Handler) http.Handler
func (*Middleware) RequireAppPortalApplication ¶
func (m *Middleware) RequireAppPortalApplication() func(next http.Handler) http.Handler
func (*Middleware) RequireAppPortalPermission ¶
func (*Middleware) RequireAuth ¶
func (m *Middleware) RequireAuth() func(next http.Handler) http.Handler
func (*Middleware) RequireAuthUserMetadata ¶
func (m *Middleware) RequireAuthUserMetadata() func(next http.Handler) http.Handler
func (*Middleware) RequireAuthorizedUser ¶
func (m *Middleware) RequireAuthorizedUser() func(next http.Handler) http.Handler
func (*Middleware) RequireBaseUrl ¶
func (m *Middleware) RequireBaseUrl() func(next http.Handler) http.Handler
func (*Middleware) RequireDeliveryAttempt ¶
func (m *Middleware) RequireDeliveryAttempt() func(next http.Handler) http.Handler
func (*Middleware) RequireEvent ¶
func (m *Middleware) RequireEvent() func(next http.Handler) http.Handler
func (*Middleware) RequireEventDelivery ¶
func (m *Middleware) RequireEventDelivery() func(next http.Handler) http.Handler
func (*Middleware) RequireGroup ¶
func (m *Middleware) RequireGroup() func(next http.Handler) http.Handler
func (*Middleware) RequireOrganisation ¶
func (m *Middleware) RequireOrganisation() func(next http.Handler) http.Handler
func (*Middleware) RequireOrganisationGroupMember ¶
func (m *Middleware) RequireOrganisationGroupMember() func(next http.Handler) http.Handler
func (*Middleware) RequireOrganisationMemberRole ¶
func (*Middleware) RequireOrganisationMembership ¶
func (m *Middleware) RequireOrganisationMembership() func(next http.Handler) http.Handler
func (*Middleware) RequirePermission ¶
func (*Middleware) WriteRequestIDHeader ¶
func (m *Middleware) WriteRequestIDHeader(next http.Handler) http.Handler
Click to show internal directories.
Click to hide internal directories.