util

package
v0.0.0-...-a508f9c Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUnmarshalJSON

func GetUnmarshalJSON(c *http.Client, url string, target interface{}) error

GetUnmarshalJSON gets a JSON response from url and unmarshals into target

func ReadCookies

func ReadCookies(h http.Header, filter string) []*http.Cookie

ReadCookies parses all "Cookie" values from the header h and returns the successfully parsed Cookies.

if filter isn't empty, only cookies of that name are returned

func ReadSetCookies

func ReadSetCookies(h http.Header) []*http.Cookie

ReadSetCookies parses all "Set-Cookie" values from the header h and returns the successfully parsed Cookies.

func UnmarshalJSON

func UnmarshalJSON(
	resp *http.Response,
	target interface{},
) error

UnmarshalJSON unmarshalls an HTTP response with json.Unmarshal

Types

type Config

type Config struct {
	Albums     []*ConfigAlbum   `yaml:"albums"`
	Every      string           `yaml:"every,omitempty"`
	Prometheus ConfigPrometheus `yaml:"prometheus,omitempty"`
	Pprof      ConfigPprof      `yaml:"pprof,omitempty"`
}

Config has all the config (aside from credentials) for what to do.

func LoadConfig

func LoadConfig(filename string) (*Config, error)

type ConfigAlbum

type ConfigAlbum struct {
	Name         string             `yaml:"name"`
	DryRun       *bool              `yaml:"dryRun,omitempty"`
	Delete       *bool              `yaml:"delete,omitempty"`
	ForcePublish *bool              `yaml:"forcePublish,omitempty"`
	Sources      ConfigAlbumSources `yaml:"sources"`
}

type ConfigAlbumSources

type ConfigAlbumSources struct {
	Googlephotos []string `json:"googlephotos,omitempty"`
}

type ConfigPprof

type ConfigPprof struct {
	Listen string `yaml:"listen"`
}

type ConfigPrometheus

type ConfigPrometheus struct {
	Listen string `yaml:"listen"`
}

Jump to

Keyboard shortcuts

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