googlesheetsplugin

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Plugin = &pluginimpl.Plugin{
	ID:  "googlesheets",
	Doc: "TODO",
	Members: map[string]*pluginimpl.PluginMember{
		"open": pluginimpl.NewMethodMember(
			"TODO",
			func(
				_ context.Context,
				name string,
				args []*apivalues.Value,
				kwargs map[string]*apivalues.Value,
				funcToValue pluginimpl.FuncToValueFunc,
			) (*apivalues.Value, error) {
				var token []byte

				if err := pluginimpl.UnpackArgs(args, kwargs, "token", &token); err != nil {
					return nil, err
				}

				ctx := context.Background()

				client, err := clientFromToken(ctx, token)
				if err != nil {
					return nil, err
				}

				srv, err := sheets.NewService(ctx, option.WithHTTPClient(client))
				if err != nil {
					return nil, fmt.Errorf("new sheets srv: %w", err)
				}

				return newSheets(funcToValue, srv), nil
			},
		),
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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