Versions in this module Expand all Collapse all v0 v0.1.0 Nov 10, 2026 Changes in this version + var ErrClient = errors.New("invalid_client") + var ErrConflict = errors.New("conflict") + var ErrForbidden = errors.New("forbidden") + var ErrInput = errors.New("invalid_input") + var ErrNotFound = errors.New("not_found") + var ErrQuota = errors.New("quota_exceeded") + var ErrUnauthenticated = errors.New("unauthenticated") + var ErrUnavailable = errors.New("unavailable") + var Scopes = []string + func OpenAPI() []byte + type Acknowledgement struct + Note string + Status string + type AppRecord struct + Owner string + SecretHash string + View Application + type Application struct + ApprovedScopes []string + ClientType string + CreatedAt time.Time + CredentialRevision int64 + ID string + Name string + Note string + Policy Policy + Purpose string + RedirectURIs []string + RequestedScopes []string + Revision int64 + State string + type ApplicationInput struct + ClientType string + Name string + Purpose string + RedirectURIs []string + RequestedScopes []string + Revision int64 + type AuthorizationResult struct + RedirectURI string + type CatalogItem struct + Biography string + CourseID string + DepartmentID string + ID string + Kind string + Name string + Revision int64 + SchoolID string + TermID string + type Consent struct + Application Application + ExpiresAt time.Time + ID string + QQTiers []string + RedirectURI string + Scopes []string + type ConsentDecision struct + Decision string + Scopes []string + type ConsentInput struct + Challenge string + ClientID string + Method string + RedirectURI string + Scopes []string + State string + type ConsentRecord struct + CodeExpiresAt time.Time + CodeHash string + Consumed bool + Decision string + GrantID string + GrantRevision int64 + Input ConsentInput + Owner string + Selected []string + View Consent + type Credential struct + AppID string + Retrievable bool + Revision int64 + Secret string + type Data struct + Catalog *[]CatalogItem + Next string + Profile *Profile + QQBinding *QQBinding + Reviews *[]ReviewItem + Schedule *[]ScheduleItem + Schools *[]School + Scope string + StudentStatus *StudentStatus + Subject string + type Grant struct + AppID string + AppName string + ExpiresAt time.Time + ID string + Revision int64 + Scopes []string + State string + Subject string + type GrantRecord struct + AppRevision int64 + Owner string + View Grant + type Notice struct + AcknowledgedAt *time.Time + Acknowledgement string + AppID string + CreatedAt time.Time + ID string + Note string + Reason string + Scopes []string + SeenAt *time.Time + Sequence int64 + Subject string + type Page struct + Items []T + Next string + type Policy struct + DailyQuota int + GrantSeconds int + TokenSeconds int + type Principal struct + Admin bool + Owner string + type Profile struct + Bio string + ID string + Nickname string + type QQBinding struct + Bound bool + Number string + type Query struct + After string + ID string + Kind string + Limit int + Query string + TargetID string + TermID string + type Repository interface + LocateCode func(context.Context, string) (ConsentRecord, error) + LocateConsent func(context.Context, string) (ConsentRecord, error) + LocateGrant func(context.Context, string) (GrantRecord, error) + LocateToken func(context.Context, string) (TokenRecord, GrantRecord, error) + Transaction func(context.Context, string, string, func(Transaction) error) error + WorkCandidates func(context.Context, time.Time, int) ([]GrantRecord, error) + type ReviewInput struct + ApprovedScopes []string + Decision string + Note string + Policy Policy + Revision int64 + type ReviewItem struct + Body string + CreatedAt time.Time + ID string + Kind string + Ratings [5]int + TargetID string + type RevokeInput struct + Revision int64 + Scopes []string + type ScheduleItem struct + Active bool + ClassID string + CourseID string + CourseName string + FetchedAt time.Time + ID string + Meetings []ScheduleMeeting + TermID string + type ScheduleMeeting struct + ID string + Location string + TimeText string + type School struct + ID string + Name string + type Service struct + CodeKey []byte + Issuer string + Now func() time.Time + Random io.Reader + Repo Repository + Source Source + func (s *Service) Acknowledge(ctx context.Context, p Principal, app, secret, id, key string, ...) (Notice, error) + func (s *Service) Application(ctx context.Context, p Principal, id string) (Application, error) + func (s *Service) Applications(ctx context.Context, p Principal, admin bool, after string, limit int) (Page[Application], error) + func (s *Service) Apply(ctx context.Context, p Principal, id, key string, in ApplicationInput) (Application, error) + func (s *Service) Cleanup(ctx context.Context, limit int) (int, error) + func (s *Service) CloseAccount(ctx context.Context, owner, closureID string) error + func (s *Service) Consent(ctx context.Context, p Principal, id string) (Consent, error) + func (s *Service) Decide(ctx context.Context, p Principal, id, key string, in ConsentDecision) (AuthorizationResult, error) + func (s *Service) Exchange(ctx context.Context, in TokenInput) (Token, error) + func (s *Service) Grants(ctx context.Context, p Principal, after string, limit int) (Page[Grant], error) + func (s *Service) Notices(ctx context.Context, p Principal, app, secret, after string, limit int) (Page[Notice], error) + func (s *Service) PrepareConsent(ctx context.Context, p Principal, key string, in ConsentInput) (Consent, error) + func (s *Service) Read(ctx context.Context, token, scope string, q Query) (Data, error) + func (s *Service) Review(ctx context.Context, p Principal, id, key string, in ReviewInput) (Application, error) + func (s *Service) Revoke(ctx context.Context, p Principal, id, key string, in RevokeInput) (Grant, error) + func (s *Service) RotateCredential(ctx context.Context, p Principal, id, key string, revision int64) (Credential, error) + func (s *Service) Validate() error + func (s *Service) Work(ctx context.Context, limit int) (int, error) + type Source interface + Read func(context.Context, string, string, Query) (Data, error) + type StudentStatus struct + EvaluatedAt time.Time + Verified bool + type Token struct + AccessToken string + ExpiresIn int64 + Scope string + Subject string + TokenType string + type TokenInput struct + ClientID string + ClientSecret string + Code string + GrantType string + RedirectURI string + Verifier string + type TokenRecord struct + AppRevision int64 + ConsentID string + ExpiresAt time.Time + GrantID string + GrantRevision int64 + Hash string + type Transaction interface + App func(string) (AppRecord, error) + Apps func(string, bool, string, int) ([]AppRecord, error) + CloseOwner func(string, string) error + Closed func(string) (bool, error) + Consent func(string) (ConsentRecord, error) + CountApps func(string) (int, error) + Event func(string, string, string, string) error + Grant func(string) (GrantRecord, error) + Grants func(string, string, int) ([]GrantRecord, error) + Notice func(string) (Notice, error) + Notices func(string, string, int) ([]Notice, error) + OwnerGrant func(string, string) (GrantRecord, error) + PendingConsents func(string, time.Time) (int, error) + Quota func(string, string, int) error + Replay func(string, string) (string, json.RawMessage, error) + RevokeCodeTokens func(string, string) error + SaveApp func(AppRecord) error + SaveConsent func(ConsentRecord) error + SaveGrant func(GrantRecord) error + SaveNotice func(Notice) error + SaveReplay func(string, string, string, json.RawMessage) error + SaveToken func(TokenRecord) error + SuspendOwnedApps func(string) error + Token func(string) (TokenRecord, error)