bring

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

View Source
const (
	CONTENT_TYPE_X_WWW_FORM_URL_URL_ENCODED = "application/x-www-form-urlencoded"
	CONTEXT_TYPE_JSON                       = "application/json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bring

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

func New

func New(conf Config, logger *slog.Logger) *Bring

func (*Bring) AddItem

func (b *Bring) AddItem(listID string, name, sub string) error

func (*Bring) GetList

func (b *Bring) GetList(listID string) (*model.ListDetailResponse, error)

func (*Bring) GetLists

func (b *Bring) GetLists() (*model.GetListsResponse, error)

func (*Bring) GetUserBaseUrl

func (b *Bring) GetUserBaseUrl() (string, error)

func (*Bring) Login

func (b *Bring) Login() error

type Config

type Config struct {
	BaseURL        string        `envconfig:"BRING_BASE_URL" default:"https://api.getbring.com/rest/v2"`
	ClientID       string        `envconfig:"BRING_CLIENT_ID" default:"webApp"`
	Country        string        `envconfig:"BRING_COUNTRY" default:"DE"`
	ApiKey         string        `envconfig:"BRING_API_KEY" default:"cof4Nc6D8saplXjE3h3HXqHH8m7VU2i1Gs0g85Sp"`
	User           string        `envconfig:"BRING_USER"`
	Password       string        `envconfig:"BRING_PASSWORD"`
	DefaultTimeout time.Duration `default:"10s"`
}

func NewConfig

func NewConfig(filenames ...string) (Config, error)

type Creds

type Creds struct {
	UserID       string
	AccessToken  string
	RefreshToken string
	TokenType    string
	ExpiresIn    int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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