Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKey ¶
GetKey sanitizes the source/target repo+branch with the change_num to construct an ID appropriate for Firestore. Eg: sourceRepo=skia, sourceBranch=chrome/m100, targetRepo=skia, targetBranch=android/next-release and changeNum=12 will return "skia-chrome-m100_skia-android-next-release_12".
Types ¶
type CherrypickData ¶
type CherrypickData struct { Created time.Time `firestore:"created"` ChangeNumber int64 `firestore:"change_number"` }
CherrypickData is the type that will be stored in FirestoreDB.
type FirestoreDB ¶
type FirestoreDB struct {
// contains filtered or unexported fields
}
FirestoreDB uses Cloud Firestore for storage.
func New ¶
func New(ctx context.Context, ts oauth2.TokenSource, fsNamespace, fsProjectId string) (*FirestoreDB, error)
New returns an instance of FirestoreDB.
func (*FirestoreDB) GetFromDB ¶
func (f *FirestoreDB) GetFromDB(ctx context.Context, key string) (*CherrypickData, error)
GetFromDB returns a CherrypickData document snapshot from Firestore. If the document is not found then (nil, nil) is returned.
Click to show internal directories.
Click to hide internal directories.