Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type AuthEmailSendVerificationResponse
- type AuthEmailSendVerificationResponseVerify
- type AuthEmailService
- type AuthLoginParams
- type AuthLoginResponse
- type AuthService
- type AuthSetupGetResponse
- type AuthSetupNewParams
- type AuthSetupNewResponse
- type AuthSetupService
- type AuthSignupParams
- type AuthSignupResponse
- type AuthUser
- type Board
- type BoardListParams
- type BoardListResponse
- type BoardListResponseBoard
- type BoardService
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type CurrentUserVote
- type Error
- type Post
- type PostAuthor
- type PostDeleteParams
- type PostGetBySlugParams
- type PostGetBySlugResponse
- type PostGetBySlugResponsePost
- type PostListParams
- type PostListResponse
- type PostNewParams
- type PostNewResponse
- type PostNewResponsePost
- type PostService
- func (r *PostService) Delete(ctx context.Context, body PostDeleteParams, opts ...option.RequestOption) (err error)
- func (r *PostService) GetBySlug(ctx context.Context, body PostGetBySlugParams, opts ...option.RequestOption) (res *PostGetBySlugResponse, err error)
- func (r *PostService) List(ctx context.Context, body PostListParams, opts ...option.RequestOption) (res *PostListResponse, err error)
- func (r *PostService) New(ctx context.Context, body PostNewParams, opts ...option.RequestOption) (res *PostNewResponse, err error)
- func (r *PostService) Update(ctx context.Context, opts ...option.RequestOption) (err error)
- type PostVote
- type PostVoteVote
- type Roadmap
- type RoadmapGetByURLResponse
- type RoadmapListParams
- type RoadmapListResponse
- type RoadmapListResponsePageInfo
- type RoadmapPrivate
- type RoadmapSearchByNameResponse
- type RoadmapService
- func (r *RoadmapService) GetByURL(ctx context.Context, url string, opts ...option.RequestOption) (res *RoadmapGetByURLResponse, err error)
- func (r *RoadmapService) List(ctx context.Context, query RoadmapListParams, opts ...option.RequestOption) (res *RoadmapListResponse, err error)
- func (r *RoadmapService) SearchByName(ctx context.Context, name string, opts ...option.RequestOption) (res *RoadmapSearchByNameResponse, err error)
- type VoteAddParams
- type VoteAddResponse
- type VoteRemoveParams
- type VoteRemoveResponse
- type VoteService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (LOGCHIMP_API_KEY, LOGCHIMP_PROTOCOL, LOGCHIMP_HOST_WITH_PORT, LOGCHIMP_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type AuthEmailSendVerificationResponse ¶
type AuthEmailSendVerificationResponse struct {
Verify AuthEmailSendVerificationResponseVerify `json:"verify"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Verify respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AuthEmailSendVerificationResponse) RawJSON ¶
func (r AuthEmailSendVerificationResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AuthEmailSendVerificationResponse) UnmarshalJSON ¶
func (r *AuthEmailSendVerificationResponse) UnmarshalJSON(data []byte) error
type AuthEmailSendVerificationResponseVerify ¶
type AuthEmailSendVerificationResponseVerify struct {
Success bool `json:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AuthEmailSendVerificationResponseVerify) RawJSON ¶
func (r AuthEmailSendVerificationResponseVerify) RawJSON() string
Returns the unmodified JSON received from the API
func (*AuthEmailSendVerificationResponseVerify) UnmarshalJSON ¶
func (r *AuthEmailSendVerificationResponseVerify) UnmarshalJSON(data []byte) error
type AuthEmailService ¶
type AuthEmailService struct {
Options []option.RequestOption
}
AuthEmailService contains methods and other services that help with interacting with the logchimp API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAuthEmailService method instead.
func NewAuthEmailService ¶
func NewAuthEmailService(opts ...option.RequestOption) (r AuthEmailService)
NewAuthEmailService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AuthEmailService) SendVerification ¶
func (r *AuthEmailService) SendVerification(ctx context.Context, opts ...option.RequestOption) (res *AuthEmailSendVerificationResponse, err error)
Send a verification email to the user email address. The email is only sent if have configured [SMTP mail server](https://docs.logchimp.codecarrot.net/docs/environment-variables#mail) are configured at the time of deploying LogChimp.
type AuthLoginParams ¶
type AuthLoginParams struct {
Email string `json:"email,required" format:"email"`
Password string `json:"password,required" format:"password"`
// contains filtered or unexported fields
}
func (AuthLoginParams) MarshalJSON ¶
func (r AuthLoginParams) MarshalJSON() (data []byte, err error)
func (*AuthLoginParams) UnmarshalJSON ¶
func (r *AuthLoginParams) UnmarshalJSON(data []byte) error
type AuthLoginResponse ¶
type AuthLoginResponse struct {
User AuthUser `json:"user"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
User respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AuthLoginResponse) RawJSON ¶
func (r AuthLoginResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AuthLoginResponse) UnmarshalJSON ¶
func (r *AuthLoginResponse) UnmarshalJSON(data []byte) error
type AuthService ¶
type AuthService struct {
Options []option.RequestOption
Setup AuthSetupService
Email AuthEmailService
}
AuthService contains methods and other services that help with interacting with the logchimp API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAuthService method instead.
func NewAuthService ¶
func NewAuthService(opts ...option.RequestOption) (r AuthService)
NewAuthService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AuthService) Login ¶
func (r *AuthService) Login(ctx context.Context, body AuthLoginParams, opts ...option.RequestOption) (res *AuthLoginResponse, err error)
Login to account using email and password.
func (*AuthService) Signup ¶
func (r *AuthService) Signup(ctx context.Context, body AuthSignupParams, opts ...option.RequestOption) (res *AuthSignupResponse, err error)
Create a new user account.
type AuthSetupGetResponse ¶
type AuthSetupGetResponse struct {
// Is LogChimp onboarding completed?
IsSetup bool `json:"is_setup"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
IsSetup respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AuthSetupGetResponse) RawJSON ¶
func (r AuthSetupGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AuthSetupGetResponse) UnmarshalJSON ¶
func (r *AuthSetupGetResponse) UnmarshalJSON(data []byte) error
type AuthSetupNewParams ¶
type AuthSetupNewParams struct {
Email string `json:"email,required" format:"email"`
Password string `json:"password,required" format:"password"`
Name param.Opt[string] `json:"name,omitzero"`
// This will be shown across the website on public pages and dashboard.
SiteTitle param.Opt[string] `json:"siteTitle,omitzero"`
// contains filtered or unexported fields
}
func (AuthSetupNewParams) MarshalJSON ¶
func (r AuthSetupNewParams) MarshalJSON() (data []byte, err error)
func (*AuthSetupNewParams) UnmarshalJSON ¶
func (r *AuthSetupNewParams) UnmarshalJSON(data []byte) error
type AuthSetupNewResponse ¶
type AuthSetupNewResponse struct {
User AuthUser `json:"user"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
User respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AuthSetupNewResponse) RawJSON ¶
func (r AuthSetupNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AuthSetupNewResponse) UnmarshalJSON ¶
func (r *AuthSetupNewResponse) UnmarshalJSON(data []byte) error
type AuthSetupService ¶
type AuthSetupService struct {
Options []option.RequestOption
}
AuthSetupService contains methods and other services that help with interacting with the logchimp API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAuthSetupService method instead.
func NewAuthSetupService ¶
func NewAuthSetupService(opts ...option.RequestOption) (r AuthSetupService)
NewAuthSetupService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AuthSetupService) Get ¶
func (r *AuthSetupService) Get(ctx context.Context, opts ...option.RequestOption) (res *AuthSetupGetResponse, err error)
Get site setup information.
func (*AuthSetupService) New ¶
func (r *AuthSetupService) New(ctx context.Context, body AuthSetupNewParams, opts ...option.RequestOption) (res *AuthSetupNewResponse, err error)
Setup the site by creating the owner account.
type AuthSignupParams ¶
type AuthSignupParams struct {
Email string `json:"email,required" format:"email"`
Password string `json:"password,required" format:"password"`
// contains filtered or unexported fields
}
func (AuthSignupParams) MarshalJSON ¶
func (r AuthSignupParams) MarshalJSON() (data []byte, err error)
func (*AuthSignupParams) UnmarshalJSON ¶
func (r *AuthSignupParams) UnmarshalJSON(data []byte) error
type AuthSignupResponse ¶
type AuthSignupResponse struct {
User AuthUser `json:"user"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
User respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AuthSignupResponse) RawJSON ¶
func (r AuthSignupResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AuthSignupResponse) UnmarshalJSON ¶
func (r *AuthSignupResponse) UnmarshalJSON(data []byte) error
type AuthUser ¶
type AuthUser struct {
AuthToken string `json:"authToken"`
// URL of the user's avatar
Avatar string `json:"avatar" format:"url"`
// Email address of the user
Email string `json:"email" format:"email"`
// User's full name
Name string `json:"name"`
UserID string `json:"userId"`
// User's username
Username string `json:"username"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AuthToken respjson.Field
Avatar respjson.Field
Email respjson.Field
Name respjson.Field
UserID respjson.Field
Username respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*AuthUser) UnmarshalJSON ¶
type Board ¶
type Board struct {
BoardID string `json:"boardId,required" format:"uuid"`
Color string `json:"color,required" format:"color"`
CreatedAt string `json:"createdAt,required"`
Name string `json:"name,required"`
URL string `json:"url,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BoardID respjson.Field
Color respjson.Field
CreatedAt respjson.Field
Name respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Board) UnmarshalJSON ¶
type BoardListParams ¶
type BoardListParams struct {
// Borders are sorted by date creation.
Created param.Opt[string] `query:"created,omitzero" json:"-"`
Limit param.Opt[string] `query:"limit,omitzero" json:"-"`
Page param.Opt[string] `query:"page,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BoardListParams) URLQuery ¶
func (r BoardListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BoardListParams's query parameters as `url.Values`.
type BoardListResponse ¶
type BoardListResponse struct {
Boards []BoardListResponseBoard `json:"boards"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Boards respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BoardListResponse) RawJSON ¶
func (r BoardListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BoardListResponse) UnmarshalJSON ¶
func (r *BoardListResponse) UnmarshalJSON(data []byte) error
type BoardListResponseBoard ¶
type BoardListResponseBoard struct {
PostCount string `json:"post_count"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PostCount respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
Board
}
func (BoardListResponseBoard) RawJSON ¶
func (r BoardListResponseBoard) RawJSON() string
Returns the unmodified JSON received from the API
func (*BoardListResponseBoard) UnmarshalJSON ¶
func (r *BoardListResponseBoard) UnmarshalJSON(data []byte) error
type BoardService ¶
type BoardService struct {
Options []option.RequestOption
}
BoardService contains methods and other services that help with interacting with the logchimp API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBoardService method instead.
func NewBoardService ¶
func NewBoardService(opts ...option.RequestOption) (r BoardService)
NewBoardService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*BoardService) List ¶
func (r *BoardService) List(ctx context.Context, query BoardListParams, opts ...option.RequestOption) (res *BoardListResponse, err error)
Get all the boards
type Client ¶
type Client struct {
Options []option.RequestOption
Auth AuthService
Posts PostService
Votes VoteService
Boards BoardService
Roadmaps RoadmapService
}
Client creates a struct with services and top level methods that help with interacting with the logchimp API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (LOGCHIMP_API_KEY, LOGCHIMP_PROTOCOL, LOGCHIMP_HOST_WITH_PORT, LOGCHIMP_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type CurrentUserVote ¶
type CurrentUserVote struct {
CreatedAt string `json:"createdAt,required"`
PostID string `json:"postId,required"`
UserID string `json:"userId,required"`
VoteID string `json:"voteId,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
PostID respjson.Field
UserID respjson.Field
VoteID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CurrentUserVote) RawJSON ¶
func (r CurrentUserVote) RawJSON() string
Returns the unmodified JSON received from the API
func (*CurrentUserVote) UnmarshalJSON ¶
func (r *CurrentUserVote) UnmarshalJSON(data []byte) error
type Post ¶
type Post struct {
Author PostAuthor `json:"author,required"`
Board Board `json:"board,required"`
CreatedAt string `json:"createdAt,required"`
PostID string `json:"postId,required"`
Slug string `json:"slug,required"`
// Title of the post.
Title string `json:"title,required"`
UpdatedAt string `json:"updatedAt,required"`
Voters PostVote `json:"voters,required"`
// Post description.
ContentMarkdown string `json:"contentMarkdown"`
Roadmap Roadmap `json:"roadmap"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Author respjson.Field
Board respjson.Field
CreatedAt respjson.Field
PostID respjson.Field
Slug respjson.Field
Title respjson.Field
UpdatedAt respjson.Field
Voters respjson.Field
ContentMarkdown respjson.Field
Roadmap respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Post) UnmarshalJSON ¶
type PostAuthor ¶
type PostAuthor struct {
UserID string `json:"userId,required"`
Username string `json:"username,required"`
Avatar string `json:"avatar"`
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
UserID respjson.Field
Username respjson.Field
Avatar respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PostAuthor) RawJSON ¶
func (r PostAuthor) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostAuthor) UnmarshalJSON ¶
func (r *PostAuthor) UnmarshalJSON(data []byte) error
type PostDeleteParams ¶
type PostDeleteParams struct {
ID string `json:"id,required"`
// contains filtered or unexported fields
}
func (PostDeleteParams) MarshalJSON ¶
func (r PostDeleteParams) MarshalJSON() (data []byte, err error)
func (*PostDeleteParams) UnmarshalJSON ¶
func (r *PostDeleteParams) UnmarshalJSON(data []byte) error
type PostGetBySlugParams ¶
type PostGetBySlugParams struct {
Slug string `json:"slug,required"`
UserID param.Opt[string] `json:"userId,omitzero" format:"uuid"`
// contains filtered or unexported fields
}
func (PostGetBySlugParams) MarshalJSON ¶
func (r PostGetBySlugParams) MarshalJSON() (data []byte, err error)
func (*PostGetBySlugParams) UnmarshalJSON ¶
func (r *PostGetBySlugParams) UnmarshalJSON(data []byte) error
type PostGetBySlugResponse ¶
type PostGetBySlugResponse struct {
Post PostGetBySlugResponsePost `json:"post"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Post respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PostGetBySlugResponse) RawJSON ¶
func (r PostGetBySlugResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostGetBySlugResponse) UnmarshalJSON ¶
func (r *PostGetBySlugResponse) UnmarshalJSON(data []byte) error
type PostGetBySlugResponsePost ¶
type PostGetBySlugResponsePost struct {
SlugID string `json:"slugId,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
SlugID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
Post
}
func (PostGetBySlugResponsePost) RawJSON ¶
func (r PostGetBySlugResponsePost) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostGetBySlugResponsePost) UnmarshalJSON ¶
func (r *PostGetBySlugResponsePost) UnmarshalJSON(data []byte) error
type PostListParams ¶
type PostListParams struct {
// Sort posts by creation date in 'asc' or 'desc' order.
Created string `json:"created,required"`
// Page number of the results to fetch.
Page float64 `json:"page,required"`
// "Number of posts to return in a single request. Default is 10."
Limit param.Opt[float64] `json:"limit,omitzero"`
RoadmapID param.Opt[string] `json:"roadmapId,omitzero" format:"uuid"`
UserID param.Opt[string] `json:"userId,omitzero" format:"uuid"`
// Posts will be searched from the list of provided board IDs. If a value is not
// provided, it defaults to empty array and posts are searched from all the boards.
BoardID []string `json:"boardId,omitzero" format:"uuid"`
// contains filtered or unexported fields
}
func (PostListParams) MarshalJSON ¶
func (r PostListParams) MarshalJSON() (data []byte, err error)
func (*PostListParams) UnmarshalJSON ¶
func (r *PostListParams) UnmarshalJSON(data []byte) error
type PostListResponse ¶
type PostListResponse struct {
Posts []Post `json:"posts"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Posts respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PostListResponse) RawJSON ¶
func (r PostListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostListResponse) UnmarshalJSON ¶
func (r *PostListResponse) UnmarshalJSON(data []byte) error
type PostNewParams ¶
type PostNewParams struct {
// Title of the post.
Title string `json:"title,required"`
BoardID param.Opt[string] `json:"boardId,omitzero"`
// Post description.
ContentMarkdown param.Opt[string] `json:"contentMarkdown,omitzero"`
RoadmapID param.Opt[string] `json:"roadmapId,omitzero"`
// contains filtered or unexported fields
}
func (PostNewParams) MarshalJSON ¶
func (r PostNewParams) MarshalJSON() (data []byte, err error)
func (*PostNewParams) UnmarshalJSON ¶
func (r *PostNewParams) UnmarshalJSON(data []byte) error
type PostNewResponse ¶
type PostNewResponse struct {
Post PostNewResponsePost `json:"post"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Post respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PostNewResponse) RawJSON ¶
func (r PostNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostNewResponse) UnmarshalJSON ¶
func (r *PostNewResponse) UnmarshalJSON(data []byte) error
type PostNewResponsePost ¶
type PostNewResponsePost struct {
PostID string `json:"postId,required"`
BoardID string `json:"boardId"`
// Post description.
ContentMarkdown string `json:"contentMarkdown"`
CreatedAt string `json:"createdAt"`
RoadmapID string `json:"roadmap_id"`
Slug string `json:"slug"`
SlugID string `json:"slugId"`
// Title of the post.
Title string `json:"title"`
UpdatedAt string `json:"updatedAt"`
UserID string `json:"userId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PostID respjson.Field
BoardID respjson.Field
ContentMarkdown respjson.Field
CreatedAt respjson.Field
RoadmapID respjson.Field
Slug respjson.Field
SlugID respjson.Field
Title respjson.Field
UpdatedAt respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PostNewResponsePost) RawJSON ¶
func (r PostNewResponsePost) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostNewResponsePost) UnmarshalJSON ¶
func (r *PostNewResponsePost) UnmarshalJSON(data []byte) error
type PostService ¶
type PostService struct {
Options []option.RequestOption
}
PostService contains methods and other services that help with interacting with the logchimp API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPostService method instead.
func NewPostService ¶
func NewPostService(opts ...option.RequestOption) (r PostService)
NewPostService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PostService) Delete ¶
func (r *PostService) Delete(ctx context.Context, body PostDeleteParams, opts ...option.RequestOption) (err error)
Delete a posts
func (*PostService) GetBySlug ¶
func (r *PostService) GetBySlug(ctx context.Context, body PostGetBySlugParams, opts ...option.RequestOption) (res *PostGetBySlugResponse, err error)
Get post by Slug
func (*PostService) List ¶
func (r *PostService) List(ctx context.Context, body PostListParams, opts ...option.RequestOption) (res *PostListResponse, err error)
Get all the posts
func (*PostService) New ¶
func (r *PostService) New(ctx context.Context, body PostNewParams, opts ...option.RequestOption) (res *PostNewResponse, err error)
Create a new post
func (*PostService) Update ¶
func (r *PostService) Update(ctx context.Context, opts ...option.RequestOption) (err error)
Update a post
type PostVote ¶
type PostVote struct {
Votes []PostVoteVote `json:"votes,required"`
VotesCount float64 `json:"votesCount,required"`
ViewerVote CurrentUserVote `json:"viewerVote"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Votes respjson.Field
VotesCount respjson.Field
ViewerVote respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*PostVote) UnmarshalJSON ¶
type PostVoteVote ¶
type PostVoteVote struct {
Username string `json:"username,required"`
Avatar string `json:"avatar"`
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Username respjson.Field
Avatar respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
CurrentUserVote
}
func (PostVoteVote) RawJSON ¶
func (r PostVoteVote) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostVoteVote) UnmarshalJSON ¶
func (r *PostVoteVote) UnmarshalJSON(data []byte) error
type Roadmap ¶
type Roadmap struct {
ID any `json:"id,required"`
Color any `json:"color,required"`
Name any `json:"name,required"`
URL any `json:"url,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Color respjson.Field
Name respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Roadmap) UnmarshalJSON ¶
type RoadmapGetByURLResponse ¶
type RoadmapGetByURLResponse struct {
Roadmap Roadmap `json:"roadmap"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Roadmap respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RoadmapGetByURLResponse) RawJSON ¶
func (r RoadmapGetByURLResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RoadmapGetByURLResponse) UnmarshalJSON ¶
func (r *RoadmapGetByURLResponse) UnmarshalJSON(data []byte) error
type RoadmapListParams ¶
type RoadmapListParams struct {
// Cursor for pagination
After param.Opt[string] `query:"after,omitzero" json:"-"`
// Number of items to return in a request
First param.Opt[float64] `query:"first,omitzero" json:"-"`
// Any of "public", "private".
Visibility []string `query:"visibility,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (RoadmapListParams) URLQuery ¶
func (r RoadmapListParams) URLQuery() (v url.Values, err error)
URLQuery serializes RoadmapListParams's query parameters as `url.Values`.
type RoadmapListResponse ¶
type RoadmapListResponse struct {
PageInfo RoadmapListResponsePageInfo `json:"page_info,required"`
Results []RoadmapPrivate `json:"results,required"`
Roadmaps []RoadmapPrivate `json:"roadmaps,required"`
TotalCount int64 `json:"total_count,nullable"`
TotalPages int64 `json:"total_pages,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PageInfo respjson.Field
Results respjson.Field
Roadmaps respjson.Field
TotalCount respjson.Field
TotalPages respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RoadmapListResponse) RawJSON ¶
func (r RoadmapListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RoadmapListResponse) UnmarshalJSON ¶
func (r *RoadmapListResponse) UnmarshalJSON(data []byte) error
type RoadmapListResponsePageInfo ¶
type RoadmapListResponsePageInfo struct {
// Number of items in current page
Count int64 `json:"count,required"`
// Current page number
CurrentPage int64 `json:"current_page,required"`
// Whether there are more pages
HasNextPage bool `json:"has_next_page,required"`
// Cursor for the last item
EndCursor string `json:"end_cursor,nullable"`
// Cursor for the first item
StartCursor string `json:"start_cursor,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
CurrentPage respjson.Field
HasNextPage respjson.Field
EndCursor respjson.Field
StartCursor respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RoadmapListResponsePageInfo) RawJSON ¶
func (r RoadmapListResponsePageInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*RoadmapListResponsePageInfo) UnmarshalJSON ¶
func (r *RoadmapListResponsePageInfo) UnmarshalJSON(data []byte) error
type RoadmapPrivate ¶
type RoadmapPrivate struct {
// Roadmap creation date
CreatedAt string `json:"created_at,required"`
Display bool `json:"display,required"`
Index float64 `json:"index,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Display respjson.Field
Index respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
Roadmap
}
func (RoadmapPrivate) RawJSON ¶
func (r RoadmapPrivate) RawJSON() string
Returns the unmodified JSON received from the API
func (*RoadmapPrivate) UnmarshalJSON ¶
func (r *RoadmapPrivate) UnmarshalJSON(data []byte) error
type RoadmapSearchByNameResponse ¶
type RoadmapSearchByNameResponse struct {
Roadmaps []RoadmapPrivate `json:"roadmaps"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Roadmaps respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RoadmapSearchByNameResponse) RawJSON ¶
func (r RoadmapSearchByNameResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RoadmapSearchByNameResponse) UnmarshalJSON ¶
func (r *RoadmapSearchByNameResponse) UnmarshalJSON(data []byte) error
type RoadmapService ¶
type RoadmapService struct {
Options []option.RequestOption
}
RoadmapService contains methods and other services that help with interacting with the logchimp API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRoadmapService method instead.
func NewRoadmapService ¶
func NewRoadmapService(opts ...option.RequestOption) (r RoadmapService)
NewRoadmapService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*RoadmapService) GetByURL ¶
func (r *RoadmapService) GetByURL(ctx context.Context, url string, opts ...option.RequestOption) (res *RoadmapGetByURLResponse, err error)
Get roadmap by Url
func (*RoadmapService) List ¶
func (r *RoadmapService) List(ctx context.Context, query RoadmapListParams, opts ...option.RequestOption) (res *RoadmapListResponse, err error)
Get all roadmaps
func (*RoadmapService) SearchByName ¶
func (r *RoadmapService) SearchByName(ctx context.Context, name string, opts ...option.RequestOption) (res *RoadmapSearchByNameResponse, err error)
Search roadmaps by name
type VoteAddParams ¶
type VoteAddParams struct {
// ID of the post to vote on.
PostID string `json:"postId,required"`
// contains filtered or unexported fields
}
func (VoteAddParams) MarshalJSON ¶
func (r VoteAddParams) MarshalJSON() (data []byte, err error)
func (*VoteAddParams) UnmarshalJSON ¶
func (r *VoteAddParams) UnmarshalJSON(data []byte) error
type VoteAddResponse ¶
type VoteAddResponse struct {
Voters PostVote `json:"voters"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Voters respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (VoteAddResponse) RawJSON ¶
func (r VoteAddResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*VoteAddResponse) UnmarshalJSON ¶
func (r *VoteAddResponse) UnmarshalJSON(data []byte) error
type VoteRemoveParams ¶
type VoteRemoveParams struct {
// ID of the post to vote on.
PostID string `json:"postId,required"`
// contains filtered or unexported fields
}
func (VoteRemoveParams) MarshalJSON ¶
func (r VoteRemoveParams) MarshalJSON() (data []byte, err error)
func (*VoteRemoveParams) UnmarshalJSON ¶
func (r *VoteRemoveParams) UnmarshalJSON(data []byte) error
type VoteRemoveResponse ¶
type VoteRemoveResponse struct {
Voters PostVote `json:"voters"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Voters respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (VoteRemoveResponse) RawJSON ¶
func (r VoteRemoveResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*VoteRemoveResponse) UnmarshalJSON ¶
func (r *VoteRemoveResponse) UnmarshalJSON(data []byte) error
type VoteService ¶
type VoteService struct {
Options []option.RequestOption
}
VoteService contains methods and other services that help with interacting with the logchimp API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVoteService method instead.
func NewVoteService ¶
func NewVoteService(opts ...option.RequestOption) (r VoteService)
NewVoteService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VoteService) Add ¶
func (r *VoteService) Add(ctx context.Context, body VoteAddParams, opts ...option.RequestOption) (res *VoteAddResponse, err error)
Vote on a post
func (*VoteService) Remove ¶
func (r *VoteService) Remove(ctx context.Context, body VoteRemoveParams, opts ...option.RequestOption) (res *VoteRemoveResponse, err error)
Remove vote from a post
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|