fetch

package
v1.0.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Copyright 2016-2019 Google LLC. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// supported codelab source types must be registered parsers
	// TODO: define these in claat/parser/..., e.g. in parser/gdoc
	// alternate TODO: make this an iota-based enum?
	SrcInvalid   srcType = ""
	SrcGoogleDoc srcType = "gdoc" // Google Docs doc
	SrcMarkdown  srcType = "md"   // Markdown text

)

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

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

func NewFetcher

func NewFetcher(at string, pm map[string]bool, rt http.RoundTripper) (*Fetcher, error)

NewFetcher creates an instance of Fetcher.

func (*Fetcher) SlurpCodelab

func (f *Fetcher) SlurpCodelab(src string, output string) (*codelab, error)

SlurpCodelab retrieves and parses codelab source. It takes the source, plus an auth token and a set of extra metadata to pass along. It returns parsed codelab and its source type.

The function will also fetch and parse fragments included with nodes.ImportNode.

func (*Fetcher) SlurpImages

func (f *Fetcher) SlurpImages(src, dir string, n []nodes.Node, images map[string]string) error

type MemoryFetcher

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

func NewMemoryFetcher

func NewMemoryFetcher(pm map[string]bool) *MemoryFetcher

func (*MemoryFetcher) SlurpCodelab

func (m *MemoryFetcher) SlurpCodelab(rc io.ReadCloser) (*codelab, error)

Directories

Path Synopsis
drive

Jump to

Keyboard shortcuts

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