flags

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package flags parses args and returns them as a struct.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	BaseURL               string
	GitHubPages           bool
	GitHubPagesToken      string
	GitHubPagesUser       string
	IncludeInHead         FilePathContents
	IndexInternalPackages bool
	SourceLinkTemplate    string
	OutputPath            string
	SiteDescription       string
	SiteTitle             string
	Watch                 bool // not added as a flag, only enabled when running from ./cmd/watch
}

Args contains all command-line options for gopages

func Parse

func Parse(osArgs ...string) (Args, string, error)

Parse parses the given command line arguments into Args values and returns any output to send to the user

func (Args) Linker added in v0.1.6

func (a Args) Linker(modulePackage string) (source.Linker, error)

Linker returns an appropriate source.Linker for the given command line args

type FilePathContents added in v0.1.9

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

FilePathContents is a flag that reads a file by the passed in path and contains its contents

func (*FilePathContents) Contents added in v0.1.9

func (f *FilePathContents) Contents() []byte

Contents returns the contents of this flag's file

func (*FilePathContents) Set added in v0.1.9

func (f *FilePathContents) Set(s string) error

Set implements flag.Value

func (*FilePathContents) String added in v0.1.9

func (f *FilePathContents) String() string

type GoPagesLinker added in v0.1.6

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

GoPagesLinker is the default GoPages source.Linker, which links to scraped godoc source pages

func (*GoPagesLinker) LinkToSource added in v0.1.6

func (l *GoPagesLinker) LinkToSource(packagePath string, options source.LinkOptions) url.URL

LinkToSource implements source.Linker

type TemplateLinker added in v0.1.6

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

TemplateLinker is a custom template-based source.Linker, which links to external source pages

func (*TemplateLinker) LinkToSource added in v0.1.6

func (l *TemplateLinker) LinkToSource(packagePath string, options source.LinkOptions) url.URL

LinkToSource implements source.Linker

func (*TemplateLinker) ShouldScrapePackage added in v0.1.6

func (l *TemplateLinker) ShouldScrapePackage(packagePath string) bool

ShouldScrapePackage implements source.ScrapeChecker

Jump to

Keyboard shortcuts

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