MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / Bootstrap

Method Bootstrap

internal/store/objectstore.go:142–156  ·  view source on GitHub ↗

Bootstrap ensures the target bucket exists and synchronizes data from the object storage backend.

(ctx context.Context, exampleConfigPath string)

Source from the content-addressed store, hash-verified

140
141// Bootstrap ensures the target bucket exists and synchronizes data from the object storage backend.
142func (s *ObjectTokenStore) Bootstrap(ctx context.Context, exampleConfigPath string) error {
143 if s == nil {
144 return fmt.Errorf("object store: not initialized")
145 }
146 if err := s.ensureBucket(ctx); err != nil {
147 return err
148 }
149 if err := s.syncConfigFromBucket(ctx, exampleConfigPath); err != nil {
150 return err
151 }
152 if err := s.syncAuthFromBucket(ctx); err != nil {
153 return err
154 }
155 return nil
156}
157
158// Save persists authentication metadata to disk and uploads it to the object storage backend.
159func (s *ObjectTokenStore) Save(ctx context.Context, auth *cliproxyauth.Auth) (string, error) {

Callers

nothing calls this directly

Calls 3

ensureBucketMethod · 0.95
syncConfigFromBucketMethod · 0.95
syncAuthFromBucketMethod · 0.95

Tested by

no test coverage detected