loginslack

package module
v0.0.0-...-38d7123 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: MIT Imports: 6 Imported by: 1

README

login-slack

This is a library to get login api-token for Slack.

Synopsis

token, err := loginslack.Login("email@email.com", "password", "workspace")
if err != nil {
    log.Fatal(err)
}
log.Println(token) // print api-token like xoxs-*

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReadLimitExceeded = errors.New("read limit exceeded")
	ErrTokenNotFound     = errors.New("token not found")
	ErrSomeThingWrong    = errors.New("something wrong (It might be page design has been changed)")
)

Functions

func Login

func Login(email, password, workspace string, opts ...Option) (string, error)

Login gets api-token (for only login user) after logged-in.

Types

type OpError

type OpError struct {
	// Op is the operation which caused the error, such as
	// "basic authentication" or "two factor authentication".
	Op string

	// Err is the error that occurred during the operation.
	Err error
}

OpError is the error type usually returned by functions in the loginslack package.

func (*OpError) Error

func (e *OpError) Error() string

func (*OpError) Unwrap

func (e *OpError) Unwrap() error

Unwrap unpacks wrapped error that occurred during the operation.

type Option

type Option func(*options)

Option indicates functional options.

func WithTwoFactorHandler

func WithTwoFactorHandler(f func() string) Option

WithTwoFactorHandler indicates option to invoke passed handler when called two factor authentication. It should returns 6-digits string.

func WithUserAgent

func WithUserAgent(ua string) Option

WithUserAgent indicates option to change user-agent

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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