forester

package module
v0.0.0-...-fe42f08 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2023 License: Apache-2.0 Imports: 36 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

This repository has been merged into https://github.com/k0swe/forester!

Go Report Card Deploy

forester-func

Serverless cloud functions to support K0SWE's Forester amateur radio logger.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FillNewQsoFromQrz

func FillNewQsoFromQrz(ctx context.Context, m pubsub.Message) error

FillNewQsoFromQrz listens to Pub/Sub for new contacts in Firestore, and fills in missing QSO details for the contacted station from QRZ.com.

func ImportLotw

func ImportLotw(w http.ResponseWriter, r *http.Request)

ImportLotw imports QSLs from Logbook of the World and merges them into Firestore. Called via GCP Cloud Functions.

func ImportQrz

func ImportQrz(w http.ResponseWriter, r *http.Request)

ImportQrz imports QSOs from QRZ logbook and merges them into Firestore. Called via GCP Cloud Functions.

func SyncNewQso

func SyncNewQso(ctx context.Context, m pubsub.Message) error

SyncNewQso listens to Pub/Sub for new contacts in Firestore, fills missing details from the QRZ.com database, and uploads them to the QRZ.com Logbook.

func UpdateSecret

func UpdateSecret(w http.ResponseWriter, r *http.Request)

UpdateSecret allows users to add or change their stored secrets. Called via GCP Cloud Functions.

func UploadNewQsoToQrz

func UploadNewQsoToQrz(ctx context.Context, m pubsub.Message) error

UploadNewQsoToQrz listens to Pub/Sub for new contacts in Firestore, and uploads them to the QRZ.com Logbook.

Types

type FirebaseManager

type FirebaseManager struct {
	// contains filtered or unexported fields
}

func MakeFirebaseManager

func MakeFirebaseManager(ctx *context.Context, r *http.Request) (*FirebaseManager, error)

MakeFirebaseManager does a bunch of initialization. It verifies the JWT and exchanges it for a user token, and inits a Firestore connection as that user.

func (*FirebaseManager) Create

func (f *FirebaseManager) Create(qso *adifpb.Qso) error

func (*FirebaseManager) GetContacts

func (f *FirebaseManager) GetContacts() ([]FirestoreQso, error)

func (*FirebaseManager) GetLogbookProperty

func (f *FirebaseManager) GetLogbookProperty(key string) (string, error)

func (*FirebaseManager) GetUID

func (f *FirebaseManager) GetUID() string

func (*FirebaseManager) GetUserProperty

func (f *FirebaseManager) GetUserProperty(key string) (string, error)

func (*FirebaseManager) MergeQsos

func (f *FirebaseManager) MergeQsos(
	firebaseQsos []FirestoreQso,
	remoteAdi *adifpb.Adif) (int, int, int)

MergeQsos merges the remote ADIF contacts into the Firestore ones. It returns the counts of QSOs created, modified, and with no difference.

func (*FirebaseManager) SetLogbookProperty

func (f *FirebaseManager) SetLogbookProperty(key string, value string) error

func (*FirebaseManager) Update

func (f *FirebaseManager) Update(qso FirestoreQso) error

type FirestoreQso

type FirestoreQso struct {
	// contains filtered or unexported fields
}

func ParseFirestoreQso

func ParseFirestoreQso(qsoDoc *firestore.DocumentSnapshot) (FirestoreQso, error)

type SecretStore

type SecretStore struct {
	// contains filtered or unexported fields
}

func NewSecretStore

func NewSecretStore(ctx context.Context) SecretStore

func (*SecretStore) FetchSecret

func (s *SecretStore) FetchSecret(logbookID string, key string) (string, error)

FetchSecret gets the latest value of the secret for the given logbook and key.

func (*SecretStore) SetSecret

func (s *SecretStore) SetSecret(logbookID string, key string, secretValue string) (string, error)

SetSecret adds a version to the given secret, possibly creating the secret first. It returns the version name, e.g. "/projects/*/secrets/*/versions/n".

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址