MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / Init

Method Init

drivers/febbox/driver.go:31–51  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

29}
30
31func (d *FebBox) Init(ctx context.Context) error {
32 // 初始化 oauth2Config
33 oauth2Config := &clientcredentials.Config{
34 ClientID: d.ClientID,
35 ClientSecret: d.ClientSecret,
36 AuthStyle: oauth2.AuthStyleInParams,
37 TokenURL: "https://api.febbox.com/oauth/token",
38 }
39
40 d.initializeOAuth2Token(ctx, oauth2Config, d.Addition.RefreshToken)
41
42 token, err := d.oauth2Token.Token()
43 if err != nil {
44 return err
45 }
46 d.accessToken = token.AccessToken
47 d.Addition.RefreshToken = token.RefreshToken
48 op.MustSaveDriverStorage(d)
49
50 return nil
51}
52
53func (d *FebBox) Drop(ctx context.Context) error {
54 return nil

Callers

nothing calls this directly

Calls 3

initializeOAuth2TokenMethod · 0.95
MustSaveDriverStorageFunction · 0.92
TokenMethod · 0.45

Tested by

no test coverage detected