slack

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeReceiverChannel = "channel"
	TypeReceiverUser    = "user"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel added in v0.4.1

type Channel struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Client added in v0.4.1

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

func NewClient added in v0.4.1

func NewClient(opts ...ClientOption) *Client

func (*Client) GetWorkspaceChannels added in v0.4.1

func (c *Client) GetWorkspaceChannels(ctx context.Context, opts ...ClientCallOption) ([]Channel, error)

func (*Client) Notify added in v0.4.1

func (c *Client) Notify(ctx context.Context, message *Message, opts ...ClientCallOption) error

type ClientCallOption added in v0.4.1

type ClientCallOption func(*clientData)

func CallWithClientSecret added in v0.4.1

func CallWithClientSecret(authCode string, clientID, clientSecret string) ClientCallOption

func CallWithGoSlackClient added in v0.4.1

func CallWithGoSlackClient(gsc GoSlackCaller) ClientCallOption

func CallWithToken added in v0.4.1

func CallWithToken(token string) ClientCallOption

type ClientOption added in v0.4.1

type ClientOption func(*Client)

func ClientWithHTTPClient added in v0.4.1

func ClientWithHTTPClient(httpClient *http.Client) ClientOption

type Credential added in v0.4.1

type Credential struct {
	AccessToken string
	TeamName    string
}

type GoSlackCaller added in v0.4.1

type GoSlackCaller interface {
	GetConversationsForUserContext(ctx context.Context, params *goslack.GetConversationsForUserParameters) (channels []goslack.Channel, nextCursor string, err error)
	GetUserByEmailContext(ctx context.Context, email string) (*goslack.User, error)
	SendMessageContext(ctx context.Context, channel string, options ...goslack.MsgOption) (string, string, string, error)
}

type Message added in v0.4.1

type Message struct {
	ReceiverName string         `json:"receiver_name" validate:"required"`
	ReceiverType string         `json:"receiver_type" validate:"required,oneof=user channel"`
	Message      string         `json:"message"`
	Blocks       goslack.Blocks `json:"blocks"`
}

func (*Message) Validate added in v0.4.1

func (sm *Message) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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