Documentation ¶
Index ¶
- Constants
- Variables
- func Bool(v bool) *bool
- func BoolValue(v *bool) bool
- func String(v string) *string
- func StringValue(v *string) string
- type Client
- type Graph
- func (g *Graph) Add(input *GraphAddInput) (*Result, error)
- func (g *Graph) AddWithContext(ctx context.Context, input *GraphAddInput) (*Result, error)
- func (g *Graph) Create(input *GraphCreateInput) (*Result, error)
- func (g *Graph) CreateWithContext(ctx context.Context, input *GraphCreateInput) (*Result, error)
- func (g *Graph) Delete(input *GraphDeleteInput) (*Result, error)
- func (g *Graph) DeleteWithContext(ctx context.Context, input *GraphDeleteInput) (*Result, error)
- func (g *Graph) Get(input *GraphGetInput) (*GraphDefinition, error)
- func (g *Graph) GetAll() (*GraphDefinitions, error)
- func (g *Graph) GetAllWithContext(ctx context.Context) (*GraphDefinitions, error)
- func (g *Graph) GetPixelDates(input *GraphGetPixelDatesInput) (*Pixels, error)
- func (g *Graph) GetPixelDatesWithContext(ctx context.Context, input *GraphGetPixelDatesInput) (*Pixels, error)
- func (g *Graph) GetSVG(input *GraphGetSVGInput) (string, error)
- func (g *Graph) GetSVGWithContext(ctx context.Context, input *GraphGetSVGInput) (string, error)
- func (g *Graph) GetWithContext(ctx context.Context, input *GraphGetInput) (*GraphDefinition, error)
- func (g *Graph) Stats(input *GraphStatsInput) (*Stats, error)
- func (g *Graph) StatsWithContext(ctx context.Context, input *GraphStatsInput) (*Stats, error)
- func (g *Graph) Stopwatch(input *GraphStopwatchInput) (*Result, error)
- func (g *Graph) StopwatchWithContext(ctx context.Context, input *GraphStopwatchInput) (*Result, error)
- func (g *Graph) Subtract(input *GraphSubtractInput) (*Result, error)
- func (g *Graph) SubtractWithContext(ctx context.Context, input *GraphSubtractInput) (*Result, error)
- func (g *Graph) URL(input *GraphURLInput) string
- func (g *Graph) Update(input *GraphUpdateInput) (*Result, error)
- func (g *Graph) UpdatePixels(input *GraphUpdatePixelsInput) (*Result, error)
- func (g *Graph) UpdatePixelsWithContext(ctx context.Context, input *GraphUpdatePixelsInput) (*Result, error)
- func (g *Graph) UpdateWithContext(ctx context.Context, input *GraphUpdateInput) (*Result, error)
- type GraphAddInput
- type GraphCreateInput
- type GraphDefinition
- type GraphDefinitions
- type GraphDeleteInput
- type GraphGetInput
- type GraphGetPixelDatesInput
- type GraphGetSVGInput
- type GraphStatsInput
- type GraphStopwatchInput
- type GraphSubtractInput
- type GraphURLInput
- type GraphUpdateInput
- type GraphUpdatePixelsInput
- type Pixel
- func (p *Pixel) Create(input *PixelCreateInput) (*Result, error)
- func (p *Pixel) CreateWithContext(ctx context.Context, input *PixelCreateInput) (*Result, error)
- func (p *Pixel) Decrement(input *PixelDecrementInput) (*Result, error)
- func (p *Pixel) DecrementWithContext(ctx context.Context, input *PixelDecrementInput) (*Result, error)
- func (p *Pixel) Delete(input *PixelDeleteInput) (*Result, error)
- func (p *Pixel) DeleteWithContext(ctx context.Context, input *PixelDeleteInput) (*Result, error)
- func (p *Pixel) Get(input *PixelGetInput) (*Quantity, error)
- func (p *Pixel) GetWithContext(ctx context.Context, input *PixelGetInput) (*Quantity, error)
- func (p *Pixel) Increment(input *PixelIncrementInput) (*Result, error)
- func (p *Pixel) IncrementWithContext(ctx context.Context, input *PixelIncrementInput) (*Result, error)
- func (p *Pixel) Update(input *PixelUpdateInput) (*Result, error)
- func (p *Pixel) UpdateWithContext(ctx context.Context, input *PixelUpdateInput) (*Result, error)
- type PixelCreateInput
- type PixelDecrementInput
- type PixelDeleteInput
- type PixelGetInput
- type PixelIncrementInput
- type PixelInput
- type PixelUpdateInput
- type PixelWithBody
- type Pixels
- type Quantity
- type Result
- type Stats
- type User
- func (u *User) Create(input *UserCreateInput) (*Result, error)
- func (u *User) CreateWithContext(ctx context.Context, input *UserCreateInput) (*Result, error)
- func (u *User) Delete() (*Result, error)
- func (u *User) DeleteWithContext(ctx context.Context) (*Result, error)
- func (u *User) Update(input *UserUpdateInput) (*Result, error)
- func (u *User) UpdateWithContext(ctx context.Context, input *UserUpdateInput) (*Result, error)
- type UserCreateInput
- type UserProfile
- type UserProfileUpdateInput
- type UserUpdateInput
- type Webhook
- func (w *Webhook) Create(input *WebhookCreateInput) (*WebhookCreateResult, error)
- func (w *Webhook) CreateWithContext(ctx context.Context, input *WebhookCreateInput) (*WebhookCreateResult, error)
- func (w *Webhook) Delete(input *WebhookDeleteInput) (*Result, error)
- func (w *Webhook) DeleteWithContext(ctx context.Context, input *WebhookDeleteInput) (*Result, error)
- func (w *Webhook) GetAll() (*WebhookDefinitions, error)
- func (w *Webhook) GetAllWithContext(ctx context.Context) (*WebhookDefinitions, error)
- func (w *Webhook) Invoke(input *WebhookInvokeInput) (*Result, error)
- func (w *Webhook) InvokeWithContext(ctx context.Context, input *WebhookInvokeInput) (*Result, error)
- type WebhookCreateInput
- type WebhookCreateResult
- type WebhookDefinition
- type WebhookDefinitions
- type WebhookDeleteInput
- type WebhookInvokeInput
Constants ¶
const ( GraphTypeInt = "int" GraphTypeFloat = "float" )
It is the type of quantity to be handled in the graph. Only int or float are supported.
const ( GraphColorShibafu = "shibafu" GraphColorMomiji = "momiji" GraphColorSora = "sora" GraphColorIchou = "ichou" GraphColorAjisai = "ajisai" GraphColorKuro = "kuro" )
Defines the display color of the pixel in the pixelation graph. shibafu (green), momiji (red), sora (blue), ichou (yellow), ajisai (purple) and kuro (black) are supported as color kind.
const ( GraphSelfSufficientIncrement = "increment" GraphSelfSufficientDecrement = "decrement" GraphSelfSufficientNone = "none" )
If SVG graph with this field increment or decrement is referenced, Pixel of this graph itself will be incremented or decremented. It is suitable when you want to record the PVs on a web page or site simultaneously. The specification of increment or decrement is the same as Increment a Pixel and Decrement a Pixel with webhook. If not specified, it is treated as none .
const ( GraphModeShort = "short" GraphModeBadge = "badge" GraphModeLine = "line" )
Specify the graph display mode. Supported modes are short (for displaying only about 90 days), badge (Badge format pasted on GitHub README. Information for the last 49 days is expressed in 7 pixels.), and line .
const ( GraphModeSimple = "simple" GraphModeSimpleShort = "simple-short" )
Specify the graph display mode in html format.
const ( WebhookTypeAdd = "add" WebhookTypeIncrement = "increment" WebhookTypeDecrement = "decrement" WebhookTypeStopwatch = "stopwatch" WebhookTypeSubtract = "subtract" )
Specify the behavior when this Webhook is invoked.
const APIBaseURL = "https://pixe.la"
APIBaseURL is Base URL for API requests.
const APIBaseURLForV1 = APIBaseURL + "/v1"
APIBaseURLForV1 is Base URL for API version 1 requests.
const (
GraphAppearanceDark = "dark"
)
Dark theme
Variables ¶
var ErrAPICallRejected = errors.New("api call rejected")
ErrAPICallRejected API call rejected. See: https://help.pixe.la/en/blog/release-request-rejecting
var RetryCount = 0
RetryCount number of retries when an API call is rejected (max: 20)
Functions ¶
func BoolValue ¶
BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.
func StringValue ¶
StringValue returns the value of the string pointer passed in or "" if the pointer is nil.
Types ¶
type Client ¶
A Client manages communication with the Pixela User API.
func (*Client) UserProfile ¶ added in v1.2.0
func (c *Client) UserProfile() *UserProfile
UserProfile returns a new Pixela user profile API client.
type Graph ¶
A Graph manages communication with the Pixela graph API.
func (*Graph) Add ¶ added in v1.7.0
func (g *Graph) Add(input *GraphAddInput) (*Result, error)
Add quantity to the "Pixel" of the day.
func (*Graph) AddWithContext ¶ added in v1.7.0
AddWithContext quantity to the "Pixel" of the day.
func (*Graph) Create ¶
func (g *Graph) Create(input *GraphCreateInput) (*Result, error)
Create creates a new pixelation graph definition.
func (*Graph) CreateWithContext ¶ added in v1.4.0
CreateWithContext creates a new pixelation graph definition.
func (*Graph) Delete ¶
func (g *Graph) Delete(input *GraphDeleteInput) (*Result, error)
Delete deletes the predefined pixelation graph definition.
func (*Graph) DeleteWithContext ¶ added in v1.4.0
DeleteWithContext deletes the predefined pixelation graph definition.
func (*Graph) Get ¶ added in v1.3.0
func (g *Graph) Get(input *GraphGetInput) (*GraphDefinition, error)
Get gets predefined pixelation graph definitions.
func (*Graph) GetAll ¶
func (g *Graph) GetAll() (*GraphDefinitions, error)
GetAll gets all predefined pixelation graph definitions.
func (*Graph) GetAllWithContext ¶ added in v1.4.0
func (g *Graph) GetAllWithContext(ctx context.Context) (*GraphDefinitions, error)
GetAllWithContext gets all predefined pixelation graph definitions.
func (*Graph) GetPixelDates ¶
func (g *Graph) GetPixelDates(input *GraphGetPixelDatesInput) (*Pixels, error)
GetPixelDates gets a Date list of Pixel registered in the graph specified by graphID. You can specify a period with from and to parameters.
If you do not specify both from and to; You will get a list of 365 days ago from today.
If you specify from only; You will get a list of 365 days from from date.
If you specify to only; You will get a list of 365 days ago from to date.
If you specify both from andto; You will get a list you specify. You can not specify a period greater than 365 days.
func (*Graph) GetPixelDatesWithContext ¶ added in v1.4.0
func (g *Graph) GetPixelDatesWithContext(ctx context.Context, input *GraphGetPixelDatesInput) (*Pixels, error)
GetPixelDatesWithContext gets a Date list of Pixel registered in the graph specified by graphID. You can specify a period with from and to parameters.
If you do not specify both from and to; You will get a list of 365 days ago from today.
If you specify from only; You will get a list of 365 days from from date.
If you specify to only; You will get a list of 365 days ago from to date.
If you specify both from andto; You will get a list you specify. You can not specify a period greater than 365 days.
func (*Graph) GetSVG ¶
func (g *Graph) GetSVG(input *GraphGetSVGInput) (string, error)
GetSVG get a graph expressed in SVG format diagram that based on the registered information.
func (*Graph) GetSVGWithContext ¶ added in v1.4.0
GetSVGWithContext get a graph expressed in SVG format diagram that based on the registered information.
func (*Graph) GetWithContext ¶ added in v1.4.0
func (g *Graph) GetWithContext(ctx context.Context, input *GraphGetInput) (*GraphDefinition, error)
GetWithContext gets predefined pixelation graph definitions.
func (*Graph) Stats ¶
func (g *Graph) Stats(input *GraphStatsInput) (*Stats, error)
Stats gets various statistics based on the registered information.
func (*Graph) StatsWithContext ¶ added in v1.4.0
StatsWithContext gets various statistics based on the registered information.
func (*Graph) Stopwatch ¶
func (g *Graph) Stopwatch(input *GraphStopwatchInput) (*Result, error)
Stopwatch start and end the measurement of the time.
func (*Graph) StopwatchWithContext ¶ added in v1.4.0
func (g *Graph) StopwatchWithContext(ctx context.Context, input *GraphStopwatchInput) (*Result, error)
StopwatchWithContext start and end the measurement of the time.
func (*Graph) Subtract ¶ added in v1.7.0
func (g *Graph) Subtract(input *GraphSubtractInput) (*Result, error)
Subtract quantity from the "Pixel" of the day.
func (*Graph) SubtractWithContext ¶ added in v1.7.0
func (g *Graph) SubtractWithContext(ctx context.Context, input *GraphSubtractInput) (*Result, error)
SubtractWithContext quantity from the "Pixel" of the day.
func (*Graph) URL ¶
func (g *Graph) URL(input *GraphURLInput) string
URL displays the details of the graph in html format.
func (*Graph) Update ¶
func (g *Graph) Update(input *GraphUpdateInput) (*Result, error)
Update updates predefined pixelation graph definitions. The items that can be updated are limited as compared with the pixelation graph definition creation.
func (*Graph) UpdatePixels ¶ added in v1.9.0
func (g *Graph) UpdatePixels(input *GraphUpdatePixelsInput) (*Result, error)
UpdatePixels is used to register multiple Pixels (quantities for a specific day) at a time.
func (*Graph) UpdatePixelsWithContext ¶ added in v1.9.0
func (g *Graph) UpdatePixelsWithContext(ctx context.Context, input *GraphUpdatePixelsInput) (*Result, error)
UpdatePixelsWithContext is used to register multiple Pixels (quantities for a specific day) at a time.
func (*Graph) UpdateWithContext ¶ added in v1.4.0
UpdateWithContext updates predefined pixelation graph definitions. The items that can be updated are limited as compared with the pixelation graph definition creation.
type GraphAddInput ¶ added in v1.7.0
type GraphAddInput struct { // ID is a required field ID *string `json:"-"` // Quantity is a required field Quantity *string `json:"quantity"` }
GraphAddInput is input of Graph.Add().
type GraphCreateInput ¶
type GraphCreateInput struct { // ID is a required field ID *string `json:"id"` // Name is a required field Name *string `json:"name"` // Unit is a required field Unit *string `json:"unit"` // Type is a required field Type *string `json:"type"` // Color is a required field Color *string `json:"color"` TimeZone *string `json:"timezone,omitempty"` SelfSufficient *string `json:"selfSufficient,omitempty"` IsSecret *bool `json:"isSecret,omitempty"` PublishOptionalData *bool `json:"publishOptionalData,omitempty"` }
GraphCreateInput is input of Graph.Create().
type GraphDefinition ¶
type GraphDefinition struct { ID string `json:"id"` Name string `json:"name"` Unit string `json:"unit"` Type string `json:"type"` Color string `json:"color"` TimeZone string `json:"timezone"` PurgeCacheURLs []string `json:"purgeCacheURLs"` SelfSufficient string `json:"selfSufficient"` IsSecret bool `json:"isSecret"` PublishOptionalData bool `json:"publishOptionalData"` Result }
GraphDefinition is graph definition.
type GraphDefinitions ¶
type GraphDefinitions struct { Graphs []GraphDefinition `json:"graphs"` Result }
GraphDefinitions is graph definition list.
type GraphDeleteInput ¶
type GraphDeleteInput struct { // ID is a required field ID *string `json:"-"` }
GraphDeleteInput is input of Graph.Delete().
type GraphGetInput ¶ added in v1.3.0
type GraphGetInput struct { // ID is a required field ID *string `json:"-"` }
GraphGetInput is input of Graph.Get().
type GraphGetPixelDatesInput ¶
type GraphGetPixelDatesInput struct { // ID is a required field ID *string From *string To *string WithBody *bool }
GraphGetPixelDatesInput is input of Graph.GetPixelDates().
type GraphGetSVGInput ¶
type GraphGetSVGInput struct { // ID is a required field ID *string `json:"-"` Date *string `json:"date,omitempty"` Mode *string `json:"mode,omitempty"` Appearance *string `json:"appearance,omitempty"` }
GraphGetSVGInput is input of Graph.GetSVG().
type GraphStatsInput ¶
type GraphStatsInput struct { // ID is a required field ID *string }
GraphStatsInput is input of Graph.Stats().
type GraphStopwatchInput ¶
type GraphStopwatchInput struct { // ID is a required field ID *string }
GraphStopwatchInput is input of Graph.Stopwatch().
type GraphSubtractInput ¶ added in v1.7.0
type GraphSubtractInput struct { // ID is a required field ID *string `json:"-"` // Quantity is a required field Quantity *string `json:"quantity"` }
GraphSubtractInput is input of Graph.Subtract().
type GraphURLInput ¶
GraphURLInput is input of Graph.GetURL().
type GraphUpdateInput ¶
type GraphUpdateInput struct { // ID is a required field ID *string `json:"-"` Name *string `json:"name,omitempty"` Unit *string `json:"unit,omitempty"` Color *string `json:"color,omitempty"` TimeZone *string `json:"timezone,omitempty"` PurgeCacheURLs []string `json:"purgeCacheURLs,omitempty"` SelfSufficient *string `json:"selfSufficient,omitempty"` IsSecret *bool `json:"isSecret,omitempty"` PublishOptionalData *bool `json:"publishOptionalData,omitempty"` }
GraphUpdateInput is input of Graph.Update().
type GraphUpdatePixelsInput ¶ added in v1.9.0
type GraphUpdatePixelsInput struct { // ID is a required field ID *string `json:"-"` Pixels []PixelInput `json:"-"` }
GraphUpdatePixelsInput is input of Graph.UpdatePixels().
type Pixel ¶
A Pixel manages communication with the Pixela pixel API.
func (*Pixel) Create ¶
func (p *Pixel) Create(input *PixelCreateInput) (*Result, error)
Create records the quantity of the specified date as a "Pixel".
func (*Pixel) CreateWithContext ¶ added in v1.4.0
CreateWithContext records the quantity of the specified date as a "Pixel".
func (*Pixel) Decrement ¶
func (p *Pixel) Decrement(input *PixelDecrementInput) (*Result, error)
Decrement decrements quantity "Pixel" of the day (it is used "timezone" setting if Graph's "timezone" is specified, if not specified, calculates it in "UTC"). If the graph type is int then -1 added, and for float then -0.01 added.
func (*Pixel) DecrementWithContext ¶ added in v1.4.0
func (p *Pixel) DecrementWithContext(ctx context.Context, input *PixelDecrementInput) (*Result, error)
DecrementWithContext decrements quantity "Pixel" of the day (it is used "timezone" setting if Graph's "timezone" is specified, if not specified, calculates it in "UTC"). If the graph type is int then -1 added, and for float then -0.01 added.
func (*Pixel) Delete ¶
func (p *Pixel) Delete(input *PixelDeleteInput) (*Result, error)
Delete deletes the registered "Pixel".
func (*Pixel) DeleteWithContext ¶ added in v1.4.0
DeleteWithContext deletes the registered "Pixel".
func (*Pixel) Get ¶
func (p *Pixel) Get(input *PixelGetInput) (*Quantity, error)
Get gets registered quantity as "Pixel".
func (*Pixel) GetWithContext ¶ added in v1.4.0
GetWithContext gets registered quantity as "Pixel".
func (*Pixel) Increment ¶
func (p *Pixel) Increment(input *PixelIncrementInput) (*Result, error)
Increment increments quantity "Pixel" of the day (it is used "timezone" setting if Graph's "timezone" is specified, if not specified, calculates it in "UTC"). If the graph type is int then 1 added, and for float then 0.01 added.
func (*Pixel) IncrementWithContext ¶ added in v1.4.0
func (p *Pixel) IncrementWithContext(ctx context.Context, input *PixelIncrementInput) (*Result, error)
IncrementWithContext increments quantity "Pixel" of the day (it is used "timezone" setting if Graph's "timezone" is specified, if not specified, calculates it in "UTC"). If the graph type is int then 1 added, and for float then 0.01 added.
func (*Pixel) Update ¶
func (p *Pixel) Update(input *PixelUpdateInput) (*Result, error)
Update updates the quantity already registered as a "Pixel".
func (*Pixel) UpdateWithContext ¶ added in v1.4.0
UpdateWithContext updates the quantity already registered as a "Pixel".
type PixelCreateInput ¶
type PixelCreateInput struct { // GraphID is a required field GraphID *string `json:"-"` // Date is a required field Date *string `json:"date"` // Quantity is a required field Quantity *string `json:"quantity"` OptionalData *string `json:"optionalData,omitempty"` }
PixelCreateInput is input of Pixel.Create().
type PixelDecrementInput ¶
type PixelDecrementInput struct { // GraphID is a required field GraphID *string }
PixelDecrementInput is input of Pixel.Decrement().
type PixelDeleteInput ¶
type PixelDeleteInput struct { // GraphID is a required field GraphID *string // Date is a required field Date *string }
PixelDeleteInput is input of Pixel.Delete().
type PixelGetInput ¶
type PixelGetInput struct { // GraphID is a required field GraphID *string // Date is required field. Date *string }
PixelGetInput is input of Pixel.Get().
type PixelIncrementInput ¶
type PixelIncrementInput struct { // GraphID is a required field GraphID *string }
PixelIncrementInput is input of Pixel.Increment().
type PixelInput ¶ added in v1.9.0
type PixelInput struct { // Date is a required field Date *string `json:"date"` // Quantity is a required field Quantity *string `json:"quantity"` OptionalData *string `json:"optionalData,omitempty"` }
PixelInput is input of Graph.UpdatePixels().
type PixelUpdateInput ¶
type PixelUpdateInput struct { // GraphID is a required field GraphID *string `json:"-"` // Date is required field. Date *string `json:"-"` Quantity *string `json:"quantity,omitempty"` OptionalData *string `json:"optionalData,omitempty"` }
PixelUpdateInput is input of Pixel.Update().
type PixelWithBody ¶ added in v1.3.0
type PixelWithBody struct { Date string `json:"date"` Quantity string `json:"quantity"` OptionalData string `json:"optionalData"` }
PixelWithBody is Date of Pixel registered in the graph.
type Pixels ¶
type Pixels struct { // Pixels as []PixelWithBody when `withBody` is true. // Pixels as []string when `withBody` is false. Pixels interface{} Result }
Pixels is Date list of Pixel registered in the graph.
type Quantity ¶
type Quantity struct { Quantity string `json:"quantity"` OptionalData string `json:"optionalData"` Result }
Quantity ... registered quantity.
type Result ¶
type Result struct { Message string `json:"message"` IsSuccess bool `json:"isSuccess"` IsRejected bool `json:"isRejected"` StatusCode int `json:"statusCode"` }
Result is Pixela API Result struct.
type Stats ¶
type Stats struct { TotalPixelsCount int `json:"totalPixelsCount"` MaxQuantity int `json:"maxQuantity"` MaxDate string `json:"maxDate"` MinQuantity int `json:"minQuantity"` MinDate string `json:"minDate"` TotalQuantity int `json:"totalQuantity"` AvgQuantity float64 `json:"avgQuantity"` TodaysQuantity int `json:"todaysQuantity"` YesterdayQuantity int `json:"yesterdayQuantity"` Result }
Stats is various statistics based on the registered information.
type User ¶
A User manages communication with the Pixela user API.
func (*User) Create ¶
func (u *User) Create(input *UserCreateInput) (*Result, error)
Create creates a new Pixela user.
func (*User) CreateWithContext ¶ added in v1.4.0
CreateWithContext creates a new Pixela user.
func (*User) DeleteWithContext ¶ added in v1.4.0
DeleteWithContext deletes the specified registered user.
func (*User) Update ¶
func (u *User) Update(input *UserUpdateInput) (*Result, error)
Update updates the authentication token for the specified user.
func (*User) UpdateWithContext ¶ added in v1.4.0
UpdateWithContext updates the authentication token for the specified user.
type UserCreateInput ¶
type UserCreateInput struct { // AgreeTermsOfService is a required field AgreeTermsOfService *bool // NotMinor is a required field NotMinor *bool ThanksCode *string }
UserCreateInput is input of User.Create().
type UserProfile ¶ added in v1.2.0
A UserProfile manages communication with the Pixela user profile API.
func (*UserProfile) URL ¶ added in v1.2.0
func (u *UserProfile) URL() string
URL outputs the profile of the user specified by username in html format.
func (*UserProfile) Update ¶ added in v1.2.0
func (u *UserProfile) Update(input *UserProfileUpdateInput) (*Result, error)
Update updates the profile information for the user corresponding to username.
func (*UserProfile) UpdateWithContext ¶ added in v1.4.0
func (u *UserProfile) UpdateWithContext(ctx context.Context, input *UserProfileUpdateInput) (*Result, error)
UpdateWithContext updates the profile information for the user corresponding to username.
type UserProfileUpdateInput ¶ added in v1.2.0
type UserProfileUpdateInput struct { DisplayName *string `json:"displayName,omitempty"` GravatarIconEmail *string `json:"gravatarIconEmail,omitempty"` Title *string `json:"title,omitempty"` Timezone *string `json:"timezone,omitempty"` AboutURL *string `json:"aboutURL,omitempty"` ContributeURLs []string `json:"contributeURLs,omitempty"` PinnedGraphID *string `json:"pinnedGraphID,omitempty"` }
UserProfileUpdateInput is input of UserProfile.Update().
type UserUpdateInput ¶
UserUpdateInput is input of User.Update().
type Webhook ¶
A Webhook manages communication with the Pixela webhook API.
func (*Webhook) Create ¶
func (w *Webhook) Create(input *WebhookCreateInput) (*WebhookCreateResult, error)
Create create a new Webhook.
func (*Webhook) CreateWithContext ¶ added in v1.4.0
func (w *Webhook) CreateWithContext(ctx context.Context, input *WebhookCreateInput) (*WebhookCreateResult, error)
CreateWithContext create a new Webhook.
func (*Webhook) Delete ¶
func (w *Webhook) Delete(input *WebhookDeleteInput) (*Result, error)
Delete delete the registered Webhook.
func (*Webhook) DeleteWithContext ¶ added in v1.4.0
func (w *Webhook) DeleteWithContext(ctx context.Context, input *WebhookDeleteInput) (*Result, error)
DeleteWithContext delete the registered Webhook.
func (*Webhook) GetAll ¶
func (w *Webhook) GetAll() (*WebhookDefinitions, error)
GetAll get all predefined webhooks definitions.
func (*Webhook) GetAllWithContext ¶ added in v1.4.0
func (w *Webhook) GetAllWithContext(ctx context.Context) (*WebhookDefinitions, error)
GetAllWithContext get all predefined webhooks definitions.
func (*Webhook) Invoke ¶
func (w *Webhook) Invoke(input *WebhookInvokeInput) (*Result, error)
Invoke invoke the webhook registered in advance. It is used "timezone" setting as post date if Graph's "timezone" is specified, if not specified, calculates it in "UTC".
func (*Webhook) InvokeWithContext ¶ added in v1.4.0
func (w *Webhook) InvokeWithContext(ctx context.Context, input *WebhookInvokeInput) (*Result, error)
InvokeWithContext invoke the webhook registered in advance. It is used "timezone" setting as post date if Graph's "timezone" is specified, if not specified, calculates it in "UTC".
type WebhookCreateInput ¶
type WebhookCreateInput struct { // GraphID is a required filed GraphID *string `json:"graphID"` // Type is a required filed Type *string `json:"type"` }
WebhookCreateInput is input of Webhook.Create().
type WebhookCreateResult ¶
WebhookCreateResult is Create() Result struct.
type WebhookDefinition ¶
type WebhookDefinition struct { WebhookHash string `json:"webhookHash"` GraphID string `json:"graphId"` Type string `json:"type"` }
WebhookDefinition is webhook definition.
type WebhookDefinitions ¶
type WebhookDefinitions struct { Webhooks []WebhookDefinition `json:"webhooks"` Result }
WebhookDefinitions is webhook definition list.
type WebhookDeleteInput ¶
type WebhookDeleteInput struct { // WebhookHash is a required filed WebhookHash *string }
WebhookDeleteInput is input of Webhook.Delete().
type WebhookInvokeInput ¶
type WebhookInvokeInput WebhookDeleteInput
WebhookInvokeInput is input of Webhook.Invoke().