emojictl

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilenameNoExt

func FilenameNoExt(path string) string

Get a filename (without its extension if it has one) from a URI path. Includes handling filesystem paths (as they are a form of URI).

func MakeMultiPartContentTypeHeaderValue

func MakeMultiPartContentTypeHeaderValue(boundary string) string

Given a multipart form boundary, returns the header value for a multipart Content-Type header.

Types

type Emoji

type Emoji struct {
	Name     string
	Location *url.URL
}

Emoji represents an emoji.

func (*Emoji) Get

func (e *Emoji) Get() ([]byte, error)

Get retrieves the emoji data depending on its source as specified in the URI.

type Emojictl

type Emojictl interface {
	ListEmojis(context.Context) ([]*Emoji, error)
	AddEmoji(context.Context, *Emoji) error
	RemoveEmoji(context.Context, *Emoji) error
	AliasEmoji(context.Context, string, string) error
}

Emojictl descibes an interface to manage emojis.

type HTTPHeader

type HTTPHeader string

HTTPHeader represents an HTTP request or response header key

const (
	ContentType        HTTPHeader = "Content-Type"
	ContentDisposition HTTPHeader = "Content-Disposition"
)

type HTTPHeaders

type HTTPHeaders struct {
	ContentDisposition string `header:"Content-Disposition"`
	ContentType        string `header:"Content-Type"`
	Cookie             string `header:"Cookie"`
}

All supported HTTP headers in this project

func (HTTPHeaders) ToMapStringSliceString

func (h HTTPHeaders) ToMapStringSliceString() map[string][]string

ToMapStringSliceString is a helper to make HTTPHeaders compatible with stdlib types like http.Header and textproto.MIMEHeader

type HTTPMethod

type HTTPMethod string

HTTPMethod represents an HTTP request method

const (
	GET     HTTPMethod = "GET"
	HEAD    HTTPMethod = "HEAD"
	POST    HTTPMethod = "POST"
	PUT     HTTPMethod = "PUT"
	DELETE  HTTPMethod = "DELETE"
	CONNECT HTTPMethod = "CONNECT"
	OPTIONS HTTPMethod = "OPTIONS"
	TRACE   HTTPMethod = "TRACE"
	PATCH   HTTPMethod = "PATCH"
)

type MultipartBody

type MultipartBody map[string]string

MultipartBody is a declarative representation of a multipart-encoded HTTP request body

func (MultipartBody) Render

func (m MultipartBody) Render() (string, io.ReadCloser, error)

Render materializes the multipart request body from the supplied map[string]string. It returns the boundary as a string as well as an io.ReadCloser that contains the body bytes.

type SlackEmojictl

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

func NewSlackEmojictl

func NewSlackEmojictl(workspace, headerToken, bodyToken string) (*SlackEmojictl, error)

func (*SlackEmojictl) AddEmoji

func (s *SlackEmojictl) AddEmoji(ctx context.Context, e *Emoji) error

func (*SlackEmojictl) AliasEmoji

func (s *SlackEmojictl) AliasEmoji(ctx context.Context, src, dest string) error

func (*SlackEmojictl) ListEmojis

func (s *SlackEmojictl) ListEmojis(ctx context.Context) ([]*Emoji, error)

func (*SlackEmojictl) RemoveEmoji

func (s *SlackEmojictl) RemoveEmoji(ctx context.Context, e *Emoji) error

Jump to

Keyboard shortcuts

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