appclient

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 13 Imported by: 10

Documentation

Index

Constants

View Source
const (
	HeaderEtagClient = "If-None-Match"
	HeaderAuth       = "Authorization"

	AppsPluginName = "com.mattermost.apps"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*model.Client4
	*ClientPP
	// contains filtered or unexported fields
}

func AsActingUser

func AsActingUser(cc apps.Context) *Client

func AsBot

func AsBot(cc apps.Context) *Client

func NewClient

func NewClient(token, mattermostSiteURL string) *Client

func (*Client) Call

func (c *Client) Call(creq apps.CallRequest) (*apps.CallResponse, error)

func (*Client) CreatePost

func (c *Client) CreatePost(post *model.Post) (*model.Post, error)

func (*Client) DM

func (c *Client) DM(userID string, format string, args ...interface{}) (*model.Post, error)

func (*Client) DMPost

func (c *Client) DMPost(userID string, post *model.Post) (*model.Post, error)

func (*Client) GetOAuth2User

func (c *Client) GetOAuth2User(ref interface{}) error

func (*Client) GetSubscriptions

func (c *Client) GetSubscriptions() ([]apps.Subscription, error)

func (*Client) KVDelete

func (c *Client) KVDelete(prefix, id string) error

func (*Client) KVGet

func (c *Client) KVGet(prefix, id string, ref interface{}) error

func (*Client) KVSet

func (c *Client) KVSet(prefix, id string, in interface{}) (bool, error)

func (*Client) StoreOAuth2App

func (c *Client) StoreOAuth2App(oauth2App apps.OAuth2App) error

func (*Client) StoreOAuth2User

func (c *Client) StoreOAuth2User(ref interface{}) error

func (*Client) Subscribe

func (c *Client) Subscribe(sub *apps.Subscription) error

func (*Client) Unsubscribe

func (c *Client) Unsubscribe(sub *apps.Subscription) error

type ClientPP

type ClientPP struct {
	URL        string       // The location of the server, for example  "http://localhost:8065"
	HTTPClient *http.Client // The http client
	AuthToken  string
	AuthType   string
	HTTPHeader map[string]string // Headers to be copied over for each request
	// contains filtered or unexported fields
}

func NewAppsPluginAPIClient

func NewAppsPluginAPIClient(url string) *ClientPP

func NewAppsPluginAPIClientFromPluginAPI

func NewAppsPluginAPIClientFromPluginAPI(api upplugin.PluginHTTPAPI) *ClientPP

func (*ClientPP) Call

func (*ClientPP) DisableApp

func (c *ClientPP) DisableApp(appID apps.AppID) (*model.Response, error)

func (*ClientPP) DoAPIDELETE

func (c *ClientPP) DoAPIDELETE(url string) (*http.Response, error)

func (*ClientPP) DoAPIGET

func (c *ClientPP) DoAPIGET(url string, etag string) (*http.Response, error)

func (*ClientPP) DoAPIHEAD added in v1.2.0

func (c *ClientPP) DoAPIHEAD(url string, etag string) (*http.Response, error)

func (*ClientPP) DoAPIPOST

func (c *ClientPP) DoAPIPOST(url string, data string) (*http.Response, error)

func (*ClientPP) DoAPIRequest

func (c *ClientPP) DoAPIRequest(method, url, data, etag string) (*http.Response, error)

func (*ClientPP) EnableApp

func (c *ClientPP) EnableApp(appID apps.AppID) (*model.Response, error)

func (*ClientPP) GetApp

func (c *ClientPP) GetApp(appID apps.AppID) (*apps.App, *model.Response, error)

func (*ClientPP) GetListedApps

func (c *ClientPP) GetListedApps(filter string, includePlugins bool) ([]apps.ListedApp, *model.Response, error)

func (*ClientPP) GetOAuth2User

func (c *ClientPP) GetOAuth2User(ref interface{}) (*model.Response, error)

func (*ClientPP) GetPluginRoute

func (c *ClientPP) GetPluginRoute(pluginID string) string

func (*ClientPP) GetSubscriptions

func (c *ClientPP) GetSubscriptions() ([]apps.Subscription, *model.Response, error)

func (*ClientPP) InstallApp

func (c *ClientPP) InstallApp(appID apps.AppID, deployType apps.DeployType) (*apps.App, *model.Response, error)

InstallApp installs a app using a given manfest.

func (*ClientPP) KVDelete

func (c *ClientPP) KVDelete(prefix, id string) (*model.Response, error)

func (*ClientPP) KVGet

func (c *ClientPP) KVGet(prefix, id string, ref interface{}) (*model.Response, error)

func (*ClientPP) KVSet

func (c *ClientPP) KVSet(prefix, id string, in interface{}) (bool, *model.Response, error)

func (*ClientPP) SetOAuthToken

func (c *ClientPP) SetOAuthToken(token string)

func (*ClientPP) StoreOAuth2App

func (c *ClientPP) StoreOAuth2App(oauth2App apps.OAuth2App) (*model.Response, error)

func (*ClientPP) StoreOAuth2User

func (c *ClientPP) StoreOAuth2User(ref interface{}) (*model.Response, error)

func (*ClientPP) Subscribe

func (c *ClientPP) Subscribe(sub *apps.Subscription) (*model.Response, error)

func (*ClientPP) UninstallApp

func (c *ClientPP) UninstallApp(appID apps.AppID) (*model.Response, error)

func (*ClientPP) Unsubscribe

func (c *ClientPP) Unsubscribe(sub *apps.Subscription) (*model.Response, error)

func (*ClientPP) UpdateAppListing

func (c *ClientPP) UpdateAppListing(req UpdateAppListingRequest) (*apps.Manifest, *model.Response, error)

UpdateAppListing adds a specified App manifest to the local store.

type UpdateAppListingRequest

type UpdateAppListingRequest struct {
	// Manifest is the new app manifest to list.
	apps.Manifest

	// Replace causes the previously listed manifest to be dropped entirely.
	// When false, the deployment data from the new manifest will be combined
	// with the prerviously listed one.
	Replace bool

	// AddDeploys specifies which deployment types should be added to the
	// listing.
	AddDeploys apps.DeployTypes `json:"add_deploys,omitempty"`

	// RemoveDeploys specifies which deployment types should be removed from
	// the listing.
	RemoveDeploys apps.DeployTypes `json:"remove_deploys,omitempty"`
}

Jump to

Keyboard shortcuts

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