Versions in this module Expand all Collapse all v0 v0.20.1 Dec 11, 2022 v0.19.2 Dec 6, 2022 v0.19.1 Dec 5, 2022 Changes in this version + var EndpointBaseAPI = "https://api.intra.42.fr" + var EndpointCampus = EndpointBaseAPI + EndpointVersion + "/campus" + var EndpointLocations = EndpointBaseAPI + EndpointVersion + "/locations" + var EndpointUsers = EndpointBaseAPI + EndpointVersion + "/users" + var EndpointVersion = "/v2" + var ErrInvalidWebhookProcessor = errors.New("invalid webhook processor for current type") + func Client(ctx context.Context) *http.Client + type Campus struct + Active bool + Address string + City string + Country string + DefaultHiddenPhone bool + EmailExtension string + Endpoint interface{} + Facebook string + ID int + Language Language + Name string + TimeZone string + Twitter string + UsersCount int + VogsphereID int + Website string + Zip string + func CampusAll(ctx context.Context) ([]*Campus, error) + func CampusGet(ctx context.Context, campusID string) (*Campus, error) + type CampusUser struct + CampusUD int + ID int + IsPrimary bool + UserID int + func (*CampusUser) HasWebhooks() bool + func (cu *CampusUser) ProcessWebhook(ctx context.Context, metadata *WebhookMetadata, processor WebhookProcessor) error + type CampusUserWebhookProcessor interface + Create func(campusUser *CampusUser, metadata *WebhookMetadata) error + Destroy func(campusUser *CampusUser, metadata *WebhookMetadata) error + Update func(campusUser *CampusUser, metadata *WebhookMetadata) error + type ComplexLocationUser struct + Alumni bool + AnonymizeDate DuoTime + CorrectionPoint int + CreatedAt DuoTime + Displayname string + Email string + FirstName string + ID int + Image Image + IsLaunched bool + LastName string + Location string + Login string + Phone string + PoolMonth string + PoolYear string + Staff bool + URL string + UpdatedAt DuoTime + UsualFirstName string + UsualFullName string + Wallet int + type DuoTime time.Time + func (dt *DuoTime) NillableTime() *time.Time + func (dt *DuoTime) UnmarshalJSON(b []byte) error + func (dt DuoTime) Format(s string) string + func (dt DuoTime) MarshalJSON() ([]byte, error) + func (dt DuoTime) String() string + func (dt DuoTime) Time() time.Time + type HeaderLink map[string]string + type ILocationUser interface + type IWebhookPayload interface + ProcessWebhook func(ctx context.Context, metadata *WebhookMetadata, processor WebhookProcessor) error + type Image struct + Link string + Versions struct{ ... } + type Language struct + ID int + Identifier string + Name string + type Location struct + BeginAt DuoTime + CampusID int + EndAt *DuoTime + Host string + ID int + Primary bool + User UserType + func LocationsActive(ctx context.Context, campusID string) ([]*Location[ComplexLocationUser], error) + func (*Location[LocationUser]) HasWebhooks() bool + func (l *Location[LocationUser]) ProcessWebhook(ctx context.Context, metadata *WebhookMetadata, processor WebhookProcessor) error + type LocationUser struct + ID int + Login string + URL string + type LocationWebhookProcessor interface + Close func(location *Location[T], metadata *WebhookMetadata) error + Create func(location *Location[T], metadata *WebhookMetadata) error + Destroy func(location *Location[T], metadata *WebhookMetadata) error + type User struct + Email string + FirstName string + ID int + Image Image + LastName string + Login string + Phone string + PoolMonth string + PoolYear string + Staff bool + URL string + UsualFirstName string + UsualFullName string + func UserGet(ctx context.Context, userID string) (*User, error) + func (*User) HasWebhooks() bool + func (l *User) ProcessWebhook(ctx context.Context, metadata *WebhookMetadata, processor WebhookProcessor) error + type UserWebhookProcessor interface + Alumnize func(location *User, metadata *WebhookMetadata) error + Create func(location *User, metadata *WebhookMetadata) error + Update func(location *User, metadata *WebhookMetadata) error + type Webhook struct + Metadata *WebhookMetadata + Payload IWebhookPayload + func (w *Webhook) UnmarshalJSON(data []byte) error + type WebhookMetadata struct + DeliveryID string + Event string + Model string + type WebhookProcessor interface + HasWebhooks func() bool