google-meet-api

module
v0.0.0-...-c29fd12 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MIT

README

google-meet-api

Yet another Google Meet URL generation API.

Installation

go get github.com/ysugimoto/google-meet-api

Usage

This packages's interface is similar to google api library.

import (
    "log"
    "context"

    "golang.org/x/oauth2"
    "golang.org/x/oauth2/google"
    meet "github.com/ysugimoto/google-meet-api/v1"
)

func main() {
    // make oauth config from expected JSON file or GOOGLE_APPLICATION_CREDENTIALS or some way
    config, err := google.ConfigFromJSON("credential.json")
    if err != nil {
        log.Fatalln(err)
    }
    ctx := context.Background()

    // Make oauth token from suitable way and initialize client
    token := ...
    client := config.Client(ctx, token)

    // Api use
    m, err := meet.New(client)
    if err != nil {
        log.Fatalln(err)
    }
    resp, err := m.Conference.Create().Context(ctx).Do()
    if err != nil {
        log.Fatalln(err)
    }
    log.Printf("Google Meet URL Created: %s\n", resp.URL)
}

See example in detail.

How this works

Now Google Meet management API is not in API Product Index, But we can create Meet URL by accessing Google Calendar API. This package wraps thier API calling and provide simple interface like google api packages.

Testing

go test ./...

License

MIT

Author

Yoshiaki Sugimoto

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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