app

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const (
	// MaximumNameLength is the maximum length of the name of the clip.
	MaximumNameLength = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRequest

type CreateRequest struct {
	Name        string                   `json:"name"`
	Description string                   `json:"description"`
	Permission  []permissions.Permission `json:"permission"`
	CallbackURL core.String              `json:"callbackUrl,omitempty"`
}

CreateRequest represents a Create request.

func (CreateRequest) Validate

func (r CreateRequest) Validate() error

Validate request.

type Service

type Service struct {
	Call core.RequestHandlerFunc
}

Service is the base for all the endpoints on this service.

func NewService

func NewService(requestHandler core.RequestHandlerFunc) *Service

NewService creates a new Service instance.

func (*Service) Create

func (s *Service) Create(request CreateRequest) (models.App, error)

Create clip.

Example
client, _ := misskey.NewClientWithOptions(
	misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")),
)

resp, err := client.App().Create(app.CreateRequest{
	Name:        "test app",
	Description: "my test app",
	Permission: []permissions.Permission{
		permissions.Write(permissions.Account),
		permissions.Read(permissions.Account),
	},
})
if err != nil {
	log.Printf("[Apps/Create] %s", err)

	return
}

log.Printf("[Apps/Create] %s created", resp.Name)
Output:

func (*Service) Show

func (s *Service) Show(appID string) (models.App, error)

Show app.

Example
client, _ := misskey.NewClientWithOptions(
	misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")),
)

resp, err := client.App().Show("8y7eu4z91l")
if err != nil {
	log.Printf("[App/Show] %s", err)

	return
}

log.Printf("[App/Show] %s", resp.Name)
Output:

type ShowRequest

type ShowRequest struct {
	AppID string `json:"appId"`
}

ShowRequest represents an Show request.

func (ShowRequest) Validate

func (r ShowRequest) Validate() error

Validate the request.

Jump to

Keyboard shortcuts

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