pbehaviortimespan

package
v0.0.0-...-d841f61 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTimeSpans

func GetTimeSpans(s Service) gin.HandlerFunc

Get all pbehavior timespans @Summary Get all pbehavior timespans @Description Get time spans of calendar event within view span; {by_date: false} adds exception spans with types, {by_date: true} merges adjacent spans if gap between sequential ones less than 24 hours @Tags pbehavior-timespans @ID pbehavior-timespans-get-all @Accept json @Produce json @Param body body TimespansRequest true "body" @Success 200 {array} timespansItemResponse @Failure 400 {object} common.ValidationErrorResponse @Router /pbehavior-timespans [post]

func ValidateExdateRequest

func ValidateExdateRequest(sl validator.StructLevel)

func ValidateTimespansRequest

func ValidateTimespansRequest(sl validator.StructLevel)

Types

type ExdateRequest

type ExdateRequest struct {
	Begin types.CpsTime `json:"begin" binding:"required" swaggertype:"integer"`
	End   types.CpsTime `json:"end" binding:"required" swaggertype:"integer"`
	Type  string        `json:"type,omitempty"`
}

type Service

type Service interface {
	GetTimespans(request TimespansRequest) ([]timespansItemResponse, error)
}

func NewService

func NewService(dbClient mongo.DbClient, timezoneConfigProvider config.TimezoneConfigProvider) Service

type TimespansRequest

type TimespansRequest struct {
	StartAt    types.CpsTime   `json:"start_at" binding:"required" swaggertype:"integer"`
	EndAt      *types.CpsTime  `json:"end_at" swaggertype:"integer"`
	RRule      string          `json:"rrule"`
	Exdates    []ExdateRequest `json:"exdates" binding:"dive"`
	Exceptions []string        `json:"exceptions"`
	ViewFrom   types.CpsTime   `json:"view_from" binding:"required" swaggertype:"integer"`
	ViewTo     types.CpsTime   `json:"view_to" binding:"required" swaggertype:"integer"`
	ByDate     bool            `json:"by_date"`
}

Jump to

Keyboard shortcuts

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