Documentation
¶
Overview ¶
Package hduhelp is the entry point for the hduhelp-neo Go SDK, modeled on the Feishu (larksuite/oapi-sdk-go) ergonomics.
Construct a client with app credentials, then call namespaced services with fluent request builders:
client := hduhelp.NewClient(appID, appSecret)
req := academic.NewScheduleReqBuilder().SchoolYear("2025-2026").Semester(1).Build()
resp, err := client.Academic.Schedule(ctx, req)
if err != nil { return err }
if !resp.Success() { log.Println(resp.Code, resp.Msg, resp.RequestID()); return }
use(resp.Data)
The client fetches, caches, and auto-refreshes the tenant_access_token and injects it as `Authorization: Bearer <token>`. Override auth per call with the WithUserAccessToken / WithTenantAccessToken / WithPAT request options.
Index ¶
Constants ¶
const ( LogLevelError = core.LogLevelError LogLevelWarn = core.LogLevelWarn LogLevelInfo = core.LogLevelInfo LogLevelDebug = core.LogLevelDebug )
Log levels.
const DefaultBaseURL = core.DefaultBaseURL
DefaultBaseURL is the gateway used when WithBaseURL is not supplied.
Variables ¶
var ( WithBaseURL = core.WithBaseURL WithHTTPClient = core.WithHTTPClient WithReqTimeout = core.WithReqTimeout WithEnableTokenCache = core.WithEnableTokenCache WithLogLevel = core.WithLogLevel )
Client construction options.
var ( WithPAT = core.WithPAT WithUserAccessToken = core.WithUserAccessToken WithTenantAccessToken = core.WithTenantAccessToken )
Auth options. WithPAT works both at construction (client default) and as a trailing per-request option; WithUserAccessToken and WithTenantAccessToken override auth for a single call.
var ( GeneratePKCE = core.GeneratePKCE S256Challenge = core.S256Challenge NewUserTokenSource = core.NewUserTokenSource )
PKCE / user-flow helpers.
Functions ¶
This section is empty.
Types ¶
type AuthorizeParams ¶
type AuthorizeParams = core.AuthorizeParams
Option and token types re-exported so callers depend only on this package.
type Client ¶
type Client struct {
Academic *academic.Service
Admin *admin.Service
AdminNotice *adminnotice.Service
CampusLife *campuslife.Service
EmptySchedule *emptyschedule.Service
Feed *feed.Service
Graduate *graduate.Service
GroupChat *groupchat.Service
Health *health.Service
Identity *identity.Service
Inbox *inbox.Service
Knowledge *knowledge.Service
LibraryBooking *librarybooking.Service
Messaging *messaging.Service
Notification *notification.Service
Subscription *subscription.Service
Upload *upload.Service
Volunteer *volunteer.Service
// contains filtered or unexported fields
}
Client is a fully configured hduhelp-neo API client. Each field is a namespaced service; call endpoints as client.<Service>.<Method>(ctx, req, opts...).
func NewClient ¶
func NewClient(appID, appSecret string, opts ...ClientOption) *Client
NewClient builds a client from app credentials. With no options it manages the tenant_access_token automatically; options tune the base URL, HTTP client, timeout, token caching, a default PAT, and log level.
type ClientOption ¶
type ClientOption = core.ClientOption
Option and token types re-exported so callers depend only on this package.
type RequestOption ¶
type RequestOption = core.RequestOption
Option and token types re-exported so callers depend only on this package.
type UserTokenSource ¶
type UserTokenSource = core.UserTokenSource
Option and token types re-exported so callers depend only on this package.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package models provides primitives to interact with the openapi HTTP API.
|
Package models provides primitives to interact with the openapi HTTP API. |
|
service
|
|