Documentation
¶
Overview ¶
Package chik provides the public Go runtime used by generated application clients.
Package chik provides the public Go runtime used by generated application clients.
Package chik provides the public Go runtime used by generated application clients.
Package chik provides the public Go runtime used by generated application clients.
Index ¶
- Constants
- func IsChikStorageUploadCommitUnknownError(err error) bool
- func WithAuthenticationRetry(ctx context.Context) context.Context
- type Auth
- type AuthActionAccepted
- type AuthError
- type AuthSession
- type AuthUser
- type BidiStream
- type ChikAuth
- func (auth *ChikAuth) AdoptSession(ctx context.Context, session *ChikAuthSession) error
- func (auth *ChikAuth) GetSession(ctx context.Context) (*ChikAuthSession, error)
- func (auth *ChikAuth) OnAppForeground(ctx context.Context) (*ChikAuthSession, error)
- func (auth *ChikAuth) RefreshSession(ctx context.Context) (*ChikAuthSession, error)
- func (auth *ChikAuth) RequestEmailVerification(ctx context.Context) (*ChikAuthActionAccepted, error)
- func (auth *ChikAuth) RequestPasswordReset(ctx context.Context, email string) (*ChikAuthActionAccepted, error)
- func (auth *ChikAuth) ResetPassword(ctx context.Context, token, password string) (*ChikAuthUser, error)
- func (auth *ChikAuth) RestoreSession(ctx context.Context) (*ChikAuthSession, error)
- func (auth *ChikAuth) SignIn(ctx context.Context, email, password string) (*ChikAuthSession, error)
- func (auth *ChikAuth) SignInCustom(ctx context.Context, providerKey, credential string) (*ChikAuthSession, error)
- func (auth *ChikAuth) SignOut(ctx context.Context) (*ChikSignOutResult, error)
- func (auth *ChikAuth) SignUp(ctx context.Context, email, password string) (*ChikAuthUser, error)
- func (auth *ChikAuth) StartGitHub(ctx context.Context, returnTo string) (*ChikOAuthStart, error)
- func (auth *ChikAuth) StartGitHubNative(ctx context.Context) (*ChikNativeGitHubOAuthTransaction, error)
- func (auth *ChikAuth) VerifyEmail(ctx context.Context, token string) (*ChikAuthUser, error)
- type ChikAuthActionAccepted
- type ChikAuthError
- type ChikAuthSession
- type ChikAuthUser
- type ChikNativeGitHubOAuthTransaction
- type ChikOAuthStart
- type ChikRealtimeClient
- func (client *ChikRealtimeClient) Connect(options ChikRealtimeConnectionOptions) *ChikRealtimeConnection
- func (client *ChikRealtimeClient) Publish(ctx context.Context, channel string, payload any, token string) (*ChikRealtimePublishResult, error)
- func (client *ChikRealtimeClient) Subscribe(channel string, options ChikRealtimeSubscribeOptions) (*ChikRealtimeSubscription, error)
- type ChikRealtimeConnection
- type ChikRealtimeConnectionOptions
- type ChikRealtimeEvent
- type ChikRealtimeGap
- type ChikRealtimeProtocolError
- type ChikRealtimePublishResult
- type ChikRealtimeSubscribeOptions
- type ChikRealtimeSubscription
- type ChikSessionManager
- func (manager *ChikSessionManager) Adopt(ctx context.Context, session *ChikAuthSession) error
- func (manager *ChikSessionManager) Clear(ctx context.Context) error
- func (manager *ChikSessionManager) Current() *ChikAuthSession
- func (manager *ChikSessionManager) Refresh(ctx context.Context) (*ChikAuthSession, error)
- func (manager *ChikSessionManager) Restore(ctx context.Context) (*ChikAuthSession, error)
- type ChikSessionStore
- type ChikSignOutResult
- type ChikStorageAPIError
- type ChikStorageClient
- func (client *ChikStorageClient) CreateUpload(ctx context.Context, input ChikStorageCreateUploadInput) (*ChikStorageUpload, error)
- func (client *ChikStorageClient) GetDownloadURL(ctx context.Context, input ChikStorageDownloadInput) (*ChikStorageDownloadURL, error)
- func (client *ChikStorageClient) GetPublicURL(input ChikStoragePublicURLInput) string
- type ChikStorageCreateUploadInput
- type ChikStorageDownloadInput
- type ChikStorageDownloadURL
- type ChikStoragePublicURLInput
- type ChikStorageUpload
- type ChikStorageUploadCommitUnknownError
- type ChikStreamDecoder
- type ChikStreamSender
- type Client
- func (client *Client) Auth() *Auth
- func (client *Client) BidiStream(ctx context.Context, service, method string) (*BidiStream, error)
- func (client *Client) ClientStream(ctx context.Context, service, method string) (*StreamSender, error)
- func (client *Client) JSON(ctx context.Context, operation Operation, values []string, payload any, ...) ([]byte, error)
- func (client *Client) Origin() string
- func (client *Client) Raw(ctx context.Context, operation Operation, values []string, body RawBody, ...) ([]byte, error)
- func (client *Client) Realtime() *Realtime
- func (client *Client) ServerStream(ctx context.Context, service, method string, request any) (*StreamDecoder, error)
- func (client *Client) Session() *SessionManager
- func (client *Client) Storage() *Storage
- func (client *Client) Unary(ctx context.Context, service, method string, request, response any) error
- type Error
- type ErrorCode
- type ListValue
- type LiveQuery
- type LiveQueryOptions
- type LiveQuerySnapshot
- type NativeGitHubOAuthTransaction
- type OAuthStart
- type Operation
- type Options
- type RawBody
- type RawOperationOptions
- type ReactiveCursor
- type Realtime
- type RealtimeConnection
- type RealtimeConnectionOptions
- type RealtimeEvent
- type RealtimeGap
- type RealtimeProtocolError
- type RealtimePublishResult
- type RealtimeSubscribeOptions
- type RealtimeSubscription
- type SessionManager
- type SessionStore
- type SignOutResult
- type Storage
- type StorageCreateUploadInput
- type StorageDownloadInput
- type StorageDownloadURL
- type StorageError
- type StoragePublicURLInput
- type StorageUpload
- type StorageUploadCommitUnknownError
- type StreamDecoder
- type StreamSender
Constants ¶
const ( ErrorMessageAuthenticationOperationSuperseded = "The authentication operation was superseded by a newer session operation." ErrorMessageAuthenticationSessionChanged = "The authentication session changed." ErrorMessageBrowserSessionCoordinationRequired = "This browser must support same-origin session coordination to use application sessions safely." ErrorMessageCustomerAuthenticationCookieInvalid = "The customer authentication cookie is invalid." ErrorMessageCustomerSessionRequired = "A customer session is required." ErrorMessageExpectedSessionScopeInvalid = "The expected session scope is invalid." ErrorMessageGithubOauthBrowserCompletionInvalid = "The GitHub OAuth browser completion is missing or invalid." ErrorMessageGithubOauthBrowserOriginInvalid = "The GitHub OAuth browser completion must come from the application origin." ErrorMessageGithubOauthBrowserStateInvalid = "The GitHub OAuth browser state is invalid." ErrorMessageGithubOauthCallbackInvalid = "The GitHub OAuth callback is invalid." ErrorMessageGithubOauthNonceCookieRequired = "The GitHub OAuth nonce cookie is required." ErrorMessageGithubOauthSessionSnapshotInvalid = "The GitHub OAuth session snapshot has an invalid format." ErrorMessageGithubOauthStateInvalid = "The GitHub OAuth state has an invalid format." )
Variables ¶
This section is empty.
Functions ¶
func IsChikStorageUploadCommitUnknownError ¶
IsChikStorageUploadCommitUnknownError reports whether an upload requires a completion check rather than creating a fresh upload intent.
Types ¶
type AuthActionAccepted ¶
type AuthActionAccepted = ChikAuthActionAccepted
AuthActionAccepted acknowledges an authentication action.
type AuthError ¶
type AuthError = ChikAuthError
AuthError describes an application authentication failure.
type AuthSession ¶
type AuthSession = ChikAuthSession
AuthSession is an authenticated application session.
type BidiStream ¶
type BidiStream struct {
// contains filtered or unexported fields
}
BidiStream keeps a generated request stream and response stream active at the same time. Generated clients wrap it with request and response types.
func (*BidiStream) Close ¶
func (stream *BidiStream) Close() error
Close cancels both sides of the stream.
func (*BidiStream) CloseSend ¶
func (stream *BidiStream) CloseSend() error
CloseSend finishes the request side while keeping responses readable.
func (*BidiStream) Receive ¶
func (stream *BidiStream) Receive(response any) error
Receive reads one response while requests may still be sent. It returns io.EOF after the response stream completes.
func (*BidiStream) Send ¶
func (stream *BidiStream) Send(request any) error
Send writes one request without closing the response stream.
type ChikAuth ¶
type ChikAuth struct {
// contains filtered or unexported fields
}
ChikAuth exposes the authentication features configured by chick/auth.yml. All methods use the same deployment origin and customer-controlled request headers as the generated RPC client.
func (*ChikAuth) AdoptSession ¶
func (auth *ChikAuth) AdoptSession(ctx context.Context, session *ChikAuthSession) error
AdoptSession stores a native session returned by a custom sign-in or OAuth completion flow. Cookie-only responses are left in the HTTP cookie jar.
func (*ChikAuth) GetSession ¶
func (auth *ChikAuth) GetSession(ctx context.Context) (*ChikAuthSession, error)
GetSession returns the current customer session.
func (*ChikAuth) OnAppForeground ¶
func (auth *ChikAuth) OnAppForeground(ctx context.Context) (*ChikAuthSession, error)
OnAppForeground restores a native session after an application becomes active.
func (*ChikAuth) RefreshSession ¶
func (auth *ChikAuth) RefreshSession(ctx context.Context) (*ChikAuthSession, error)
RefreshSession rotates the saved native session credentials immediately.
func (*ChikAuth) RequestEmailVerification ¶
func (auth *ChikAuth) RequestEmailVerification(ctx context.Context) (*ChikAuthActionAccepted, error)
RequestEmailVerification asks the application to send a verification message for the current session.
func (*ChikAuth) RequestPasswordReset ¶
func (auth *ChikAuth) RequestPasswordReset(ctx context.Context, email string) (*ChikAuthActionAccepted, error)
RequestPasswordReset asks the application to send a password reset message.
func (*ChikAuth) ResetPassword ¶
func (auth *ChikAuth) ResetPassword(ctx context.Context, token, password string) (*ChikAuthUser, error)
ResetPassword applies a password reset token and returns the updated user.
func (*ChikAuth) RestoreSession ¶
func (auth *ChikAuth) RestoreSession(ctx context.Context) (*ChikAuthSession, error)
RestoreSession restores the saved native session and refreshes it when it is close to expiry. Without a SessionStore it returns the current cookie session instead.
func (*ChikAuth) SignIn ¶
SignIn starts a customer session. Cookie sessions are retained in the client HTTP cookie jar; native credentials are retained only through an explicitly configured SessionStore.
func (*ChikAuth) SignInCustom ¶
func (auth *ChikAuth) SignInCustom(ctx context.Context, providerKey, credential string) (*ChikAuthSession, error)
SignInCustom verifies a credential through an application-defined identity provider selected by providerKey.
func (*ChikAuth) SignOut ¶
func (auth *ChikAuth) SignOut(ctx context.Context) (*ChikSignOutResult, error)
SignOut revokes the current customer session.
func (*ChikAuth) StartGitHub ¶
StartGitHub returns the provider-neutral authorization URL configured by the application. The caller owns browser navigation and callback handling.
func (*ChikAuth) StartGitHubNative ¶
func (auth *ChikAuth) StartGitHubNative(ctx context.Context) (*ChikNativeGitHubOAuthTransaction, error)
StartGitHubNative starts a native GitHub OAuth attempt. It requires a SessionStore because successful completion is stored as a native application session rather than a browser cookie.
func (*ChikAuth) VerifyEmail ¶
VerifyEmail applies an email verification token.
type ChikAuthActionAccepted ¶
type ChikAuthActionAccepted struct {
Accepted bool `json:"accepted"`
ExpiresAt string `json:"expiresAt,omitempty"`
}
ChikAuthActionAccepted acknowledges an asynchronous authentication action.
type ChikAuthError ¶
type ChikAuthError struct {
Code ErrorCode
RawCode string
Message string
HTTPStatus int
RetryAfterSeconds int
Cause error
}
ChikAuthError is returned by a provider-neutral application authentication endpoint. It contains no identity-provider implementation details.
func (*ChikAuthError) Error ¶
func (err *ChikAuthError) Error() string
func (*ChikAuthError) Unwrap ¶
func (err *ChikAuthError) Unwrap() error
Unwrap preserves the local failure that caused this classified auth error.
type ChikAuthSession ¶
type ChikAuthSession struct {
User ChikAuthUser `json:"user"`
SessionToken string `json:"sessionToken,omitempty"`
RefreshToken string `json:"refreshToken,omitempty"`
ExpiresAt string `json:"expiresAt"`
RefreshExpiresAt string `json:"refreshExpiresAt,omitempty"`
}
ChikAuthSession is the current application session. Cookie sessions remain in the HTTP cookie jar; native responses include refreshable credentials.
type ChikAuthUser ¶
type ChikAuthUser struct {
UserID string `json:"userId"`
ProjectID string `json:"projectId"`
Email string `json:"email"`
EmailVerified bool `json:"emailVerified"`
Disabled bool `json:"disabled"`
CreatedAt string `json:"createdAt"`
}
ChikAuthUser is the public user identity returned by application auth.
type ChikNativeGitHubOAuthTransaction ¶
type ChikNativeGitHubOAuthTransaction struct {
AuthorizationURL string
RedirectURI string
ExpiresAt string
// contains filtered or unexported fields
}
ChikNativeGitHubOAuthTransaction keeps one native GitHub OAuth attempt's verification values private. Applications open AuthorizationURL in the system browser and pass the registered app-link callback to Complete.
func (*ChikNativeGitHubOAuthTransaction) Complete ¶
func (transaction *ChikNativeGitHubOAuthTransaction) Complete(ctx context.Context, redirect string) (*ChikAuthSession, error)
Complete verifies one app-link callback, exchanges its authorization code, and saves the resulting Chickinfry application session. Provider tokens are never returned to the caller.
func (*ChikNativeGitHubOAuthTransaction) MatchesRedirect ¶
func (transaction *ChikNativeGitHubOAuthTransaction) MatchesRedirect(redirect string) bool
MatchesRedirect reports whether redirect is the verified callback for this transaction. It does not consume the transaction.
type ChikOAuthStart ¶
type ChikOAuthStart struct {
AuthorizationURL string `json:"authorizationUrl"`
}
ChikOAuthStart contains the URL at which an OAuth authorization flow starts.
type ChikRealtimeClient ¶
type ChikRealtimeClient struct {
// contains filtered or unexported fields
}
ChikRealtimeClient provides publish, single-channel subscription, and multiplexed connection APIs.
func (*ChikRealtimeClient) Connect ¶
func (client *ChikRealtimeClient) Connect(options ChikRealtimeConnectionOptions) *ChikRealtimeConnection
Connect starts a reconnecting multiplexed realtime connection.
func (*ChikRealtimeClient) Publish ¶
func (client *ChikRealtimeClient) Publish(ctx context.Context, channel string, payload any, token string) (*ChikRealtimePublishResult, error)
Publish sends a JSON value to a logical realtime channel.
func (*ChikRealtimeClient) Subscribe ¶
func (client *ChikRealtimeClient) Subscribe(channel string, options ChikRealtimeSubscribeOptions) (*ChikRealtimeSubscription, error)
Subscribe starts an independently reconnecting subscription for one channel.
type ChikRealtimeConnection ¶
type ChikRealtimeConnection struct {
// contains filtered or unexported fields
}
ChikRealtimeConnection maintains multiple logical channels and restores subscriptions after transient disconnects.
func (*ChikRealtimeConnection) Close ¶
func (connection *ChikRealtimeConnection) Close()
Close stops delivery and closes the current WebSocket.
func (*ChikRealtimeConnection) Subscribe ¶
func (connection *ChikRealtimeConnection) Subscribe(channel string, lastSeq int64) error
Subscribe adds a logical channel to the multiplexed connection.
func (*ChikRealtimeConnection) Unsubscribe ¶
func (connection *ChikRealtimeConnection) Unsubscribe(channel string) error
Unsubscribe removes a logical channel from the multiplexed connection.
type ChikRealtimeConnectionOptions ¶
type ChikRealtimeConnectionOptions struct {
Token string
OnEvent func(ChikRealtimeEvent)
OnGap func(ChikRealtimeGap)
OnError func(ChikRealtimeProtocolError)
}
ChikRealtimeConnectionOptions configures a multiplexed realtime connection.
type ChikRealtimeEvent ¶
type ChikRealtimeEvent struct {
Channel string
Seq int64
TS int64
Payload json.RawMessage
}
ChikRealtimeEvent is one ordered message delivered on a logical channel.
type ChikRealtimeGap ¶
ChikRealtimeGap reports that older channel events are no longer available.
type ChikRealtimeProtocolError ¶
ChikRealtimeProtocolError is a logical delivery error.
func (ChikRealtimeProtocolError) Error ¶
func (err ChikRealtimeProtocolError) Error() string
func (ChikRealtimeProtocolError) Unwrap ¶
func (err ChikRealtimeProtocolError) Unwrap() error
Unwrap preserves the local failure that caused this classified realtime error.
type ChikRealtimePublishResult ¶
ChikRealtimePublishResult acknowledges a published message.
type ChikRealtimeSubscribeOptions ¶
type ChikRealtimeSubscribeOptions struct {
LastSeq int64
Token string
OnEvent func(ChikRealtimeEvent)
OnGap func(ChikRealtimeGap)
OnError func(ChikRealtimeProtocolError)
}
ChikRealtimeSubscribeOptions configures an independent channel subscription.
type ChikRealtimeSubscription ¶
type ChikRealtimeSubscription struct {
// contains filtered or unexported fields
}
ChikRealtimeSubscription owns a single-channel subscription.
func (*ChikRealtimeSubscription) Close ¶
func (subscription *ChikRealtimeSubscription) Close()
Close stops delivery and prevents future reconnects.
type ChikSessionManager ¶
type ChikSessionManager struct {
// contains filtered or unexported fields
}
ChikSessionManager owns one native application's stored session. It is safe for concurrent use and coalesces simultaneous restore and refresh requests into one store or network operation.
func (*ChikSessionManager) Adopt ¶
func (manager *ChikSessionManager) Adopt(ctx context.Context, session *ChikAuthSession) error
Adopt stores a native session returned by a sign-in or OAuth completion. Cookie-only sessions have no bearer credentials and are intentionally not written to a SessionStore.
func (*ChikSessionManager) Clear ¶
func (manager *ChikSessionManager) Clear(ctx context.Context) error
Clear removes the in-memory and stored native session. It is safe to call after a failed refresh or a completed sign-out.
func (*ChikSessionManager) Current ¶
func (manager *ChikSessionManager) Current() *ChikAuthSession
Current returns the current in-memory native session. It does not read the session store or make a network request.
func (*ChikSessionManager) Refresh ¶
func (manager *ChikSessionManager) Refresh(ctx context.Context) (*ChikAuthSession, error)
Refresh exchanges the current refresh token for a new native session. Concurrent callers share the same exchange result.
func (*ChikSessionManager) Restore ¶
func (manager *ChikSessionManager) Restore(ctx context.Context) (*ChikAuthSession, error)
Restore loads the stored native session and refreshes it before expiry. A nil result means that no native session has been saved.
type ChikSessionStore ¶
type ChikSessionStore interface {
LoadSession(context.Context) (*ChikAuthSession, error)
SaveSession(context.Context, *ChikAuthSession) error
ClearSession(context.Context) error
}
ChikSessionStore persists a native application's access token, refresh token, and expiry record. Desktop and CLI applications should implement it with the operating system credential store. Implementations must not log either token.
type ChikSignOutResult ¶
type ChikSignOutResult struct {
SignedOut bool `json:"signedOut"`
}
ChikSignOutResult confirms that the current application session was revoked.
type ChikStorageAPIError ¶
type ChikStorageAPIError struct {
Code ErrorCode
RawCode string
Message string
HTTPStatus int
Cause error
}
ChikStorageAPIError describes an application storage API failure.
func (*ChikStorageAPIError) Error ¶
func (err *ChikStorageAPIError) Error() string
func (*ChikStorageAPIError) Unwrap ¶
func (err *ChikStorageAPIError) Unwrap() error
Unwrap preserves the local failure that caused this classified storage error.
type ChikStorageClient ¶
type ChikStorageClient struct {
// contains filtered or unexported fields
}
ChikStorageClient exposes provider-neutral object upload and URL APIs.
func (*ChikStorageClient) CreateUpload ¶
func (client *ChikStorageClient) CreateUpload(ctx context.Context, input ChikStorageCreateUploadInput) (*ChikStorageUpload, error)
CreateUpload reserves an upload intent. A generated idempotency key is used when the caller does not provide one.
func (*ChikStorageClient) GetDownloadURL ¶
func (client *ChikStorageClient) GetDownloadURL(ctx context.Context, input ChikStorageDownloadInput) (*ChikStorageDownloadURL, error)
GetDownloadURL returns a temporary URL for an object.
func (*ChikStorageClient) GetPublicURL ¶
func (client *ChikStorageClient) GetPublicURL(input ChikStoragePublicURLInput) string
GetPublicURL returns the stable logical URL for an object in a public bucket.
type ChikStorageCreateUploadInput ¶
type ChikStorageCreateUploadInput struct {
Bucket string
Key string
ContentType string
Size int64
ContentSHA256 string
ExpiresInSeconds int
IdempotencyKey string
}
ChikStorageCreateUploadInput reserves a logical object upload.
type ChikStorageDownloadInput ¶
ChikStorageDownloadInput identifies an object for a temporary download URL.
type ChikStorageDownloadURL ¶
ChikStorageDownloadURL is a temporary URL returned by the application.
type ChikStoragePublicURLInput ¶
ChikStoragePublicURLInput identifies an object in a public logical bucket.
type ChikStorageUpload ¶
type ChikStorageUpload struct {
ID string
ExpiresAt string
// contains filtered or unexported fields
}
ChikStorageUpload owns one upload intent. Its fields are stable logical identifiers and never expose storage-provider locations.
func (*ChikStorageUpload) Abort ¶
func (upload *ChikStorageUpload) Abort(ctx context.Context) error
Abort discards an existing upload intent.
func (*ChikStorageUpload) Complete ¶
func (upload *ChikStorageUpload) Complete(ctx context.Context) (json.RawMessage, error)
Complete asks the application to verify and finalize an existing upload.
type ChikStorageUploadCommitUnknownError ¶
type ChikStorageUploadCommitUnknownError struct {
Code ErrorCode
UploadID string
Message string
HTTPStatus int
Cause error
}
ChikStorageUploadCommitUnknownError means the object transfer may have reached the application, but safe completion was not confirmed. For a single upload, call Complete before sending the body again.
func (*ChikStorageUploadCommitUnknownError) Error ¶
func (err *ChikStorageUploadCommitUnknownError) Error() string
func (*ChikStorageUploadCommitUnknownError) Unwrap ¶
func (err *ChikStorageUploadCommitUnknownError) Unwrap() error
Unwrap preserves the storage error that made completion uncertain.
type ChikStreamDecoder ¶
type ChikStreamDecoder struct {
// contains filtered or unexported fields
}
ChikStreamDecoder decodes a response stream.
func (*ChikStreamDecoder) Close ¶
func (decoder *ChikStreamDecoder) Close() error
Close cancels the client request and closes its response stream. Use a context deadline when server-side cleanup must have a bounded completion time.
func (*ChikStreamDecoder) Next ¶
func (decoder *ChikStreamDecoder) Next(message any) error
Next decodes the next generated response message and returns io.EOF at end of stream.
type ChikStreamSender ¶
type ChikStreamSender struct {
// contains filtered or unexported fields
}
ChikStreamSender sends messages to a request stream.
func (*ChikStreamSender) Close ¶
func (sender *ChikStreamSender) Close() error
Close cancels an in-progress request stream.
func (*ChikStreamSender) CloseAndReceive ¶
func (sender *ChikStreamSender) CloseAndReceive() (*ChikStreamDecoder, error)
CloseAndReceive closes the request stream and returns the response stream.
func (*ChikStreamSender) CloseAndReceiveUnary ¶
func (sender *ChikStreamSender) CloseAndReceiveUnary(response any) error
CloseAndReceiveUnary closes the request stream and decodes one unary response. It is the convenience form for client-streaming RPCs.
func (*ChikStreamSender) Send ¶
func (sender *ChikStreamSender) Send(message any) error
Send writes one generated request message to the stream.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the shared runtime behind generated application clients.
func (*Client) BidiStream ¶
BidiStream opens a request and response stream that may be used concurrently.
func (*Client) ClientStream ¶
func (client *Client) ClientStream(ctx context.Context, service, method string) (*StreamSender, error)
ClientStream opens a request stream for a declared service method.
func (*Client) JSON ¶
func (client *Client) JSON(ctx context.Context, operation Operation, values []string, payload any, options RawOperationOptions) ([]byte, error)
JSON sends a declared operation with a JSON request body.
func (*Client) Raw ¶
func (client *Client) Raw(ctx context.Context, operation Operation, values []string, body RawBody, options RawOperationOptions) ([]byte, error)
Raw sends a declared operation with a streaming request body.
func (*Client) ServerStream ¶
func (client *Client) ServerStream(ctx context.Context, service, method string, request any) (*StreamDecoder, error)
ServerStream opens a response stream for a declared service method.
func (*Client) Session ¶
func (client *Client) Session() *SessionManager
Session returns the native session manager when the client was configured with a SessionStore. It is nil for browser-style cookie sessions.
type Error ¶
type Error struct {
Code ErrorCode
RawCode string
Message string
HTTPStatus int
RetryAfterSeconds int
Cause error
}
Error describes an API request failure.
type ErrorCode ¶
type ErrorCode string
ErrorCode is a stable public failure classification.
const ( ErrorCodeCanceled ErrorCode = "canceled" ErrorCodeUnknown ErrorCode = "unknown" ErrorCodeInvalidArgument ErrorCode = "invalid_argument" ErrorCodeDeadlineExceeded ErrorCode = "deadline_exceeded" ErrorCodeAlreadyExists ErrorCode = "already_exists" ErrorCodeUnauthenticated ErrorCode = "unauthenticated" ErrorCodePermissionDenied ErrorCode = "permission_denied" ErrorCodeNotFound ErrorCode = "not_found" ErrorCodeFailedPrecondition ErrorCode = "failed_precondition" ErrorCodeAborted ErrorCode = "aborted" ErrorCodeOutOfRange ErrorCode = "out_of_range" ErrorCodeUnimplemented ErrorCode = "unimplemented" ErrorCodeResourceExhausted ErrorCode = "resource_exhausted" ErrorCodeInternal ErrorCode = "internal" ErrorCodeDataLoss ErrorCode = "data_loss" ErrorCodeNetworkFailure ErrorCode = "network_error" ErrorCodeInvalidResponse ErrorCode = "invalid_response" ErrorCodeStorageError ErrorCode = "storage_error" ErrorCodeCommitUnknown ErrorCode = "commit_unknown" ErrorCodeInvalidUploadUrl ErrorCode = "invalid_upload_url" ErrorCodeInvalidMultipartPlan ErrorCode = "invalid_multipart_plan" ErrorCodeMultipartBodyRequired ErrorCode = "multipart_body_required" ErrorCodeInvalidMultipartPart ErrorCode = "invalid_multipart_part" ErrorCodePayloadTooLarge ErrorCode = "payload_too_large" ErrorCodeResponseCredit ErrorCode = "response_credit" ErrorCodeChannelLimit ErrorCode = "channel_limit" ErrorCodeFrameAuth ErrorCode = "frame_auth" ErrorCodeHalfClose ErrorCode = "half_close" )
func ParseErrorCode ¶
ParseErrorCode never turns an unknown wire value into a known contract value.
func ParseWireErrorCode ¶
ParseWireErrorCode preserves an unrecognized received code separately from the safe fallback.
func (ErrorCode) DefaultHTTPStatus ¶
DefaultHTTPStatus returns the catalog fallback. Zero means no HTTP response exists.
func (ErrorCode) IsProtocol ¶
IsProtocol reports whether this code is valid on the shared RPC/HTTP wire.
type ListValue ¶
type ListValue[T any] struct { Values []T `json:"values"` }
ListValue represents values for a repeated field.
type LiveQuery ¶
type LiveQuery[T any] struct { // contains filtered or unexported fields }
LiveQuery controls one generated reactive list subscription.
func NewLiveQuery ¶
func NewLiveQuery[T any]( parent context.Context, client *Client, service, method string, request any, newResponse func() any, items func(any) ([]T, error), options LiveQueryOptions[T], ) (*LiveQuery[T], error)
NewLiveQuery starts a reactive list subscription for a declared service method. The generated client supplies only its typed response factory and list projection.
type LiveQueryOptions ¶
type LiveQueryOptions[T any] struct { Token string OnSnapshot func(LiveQuerySnapshot[T]) OnError func(error) }
LiveQueryOptions configures callbacks for a generated list watch method.
type LiveQuerySnapshot ¶
type LiveQuerySnapshot[T any] struct { Items []T Pending bool Version int64 Cursor *ReactiveCursor Error error }
LiveQuerySnapshot is delivered when a reactive list is registered, refreshed, or updated through the reactive WebSocket.
type NativeGitHubOAuthTransaction ¶
type NativeGitHubOAuthTransaction = ChikNativeGitHubOAuthTransaction
NativeGitHubOAuthTransaction is one native GitHub authorization attempt.
type OAuthStart ¶
type OAuthStart = ChikOAuthStart
OAuthStart contains an application authorization URL.
type Options ¶
type Options struct {
HTTPClient *http.Client
Headers http.Header
APIKey string
SessionToken string
SessionStore ChikSessionStore
APIName string
RPCPath string
}
Options configures a client instance.
type RawOperationOptions ¶
RawOperationOptions configures a declared application operation.
type ReactiveCursor ¶
ReactiveCursor identifies the most recent logical change reflected in a live query snapshot.
type Realtime ¶
type Realtime = ChikRealtimeClient
Realtime provides application realtime operations.
type RealtimeConnection ¶
type RealtimeConnection = ChikRealtimeConnection
RealtimeConnection controls a multiplexed realtime connection.
type RealtimeConnectionOptions ¶
type RealtimeConnectionOptions = ChikRealtimeConnectionOptions
RealtimeConnectionOptions configures a multiplexed realtime connection.
type RealtimeEvent ¶
type RealtimeEvent = ChikRealtimeEvent
RealtimeEvent is a message delivered on an application channel.
type RealtimeGap ¶
type RealtimeGap = ChikRealtimeGap
RealtimeGap reports unavailable older messages on an application channel.
type RealtimeProtocolError ¶
type RealtimeProtocolError = ChikRealtimeProtocolError
RealtimeProtocolError describes a realtime delivery error.
type RealtimePublishResult ¶
type RealtimePublishResult = ChikRealtimePublishResult
RealtimePublishResult acknowledges a realtime message.
type RealtimeSubscribeOptions ¶
type RealtimeSubscribeOptions = ChikRealtimeSubscribeOptions
RealtimeSubscribeOptions configures a channel subscription.
type RealtimeSubscription ¶
type RealtimeSubscription = ChikRealtimeSubscription
RealtimeSubscription controls one channel subscription.
type SessionManager ¶
type SessionManager = ChikSessionManager
SessionManager restores, refreshes, and clears a stored native session.
type SessionStore ¶
type SessionStore = ChikSessionStore
SessionStore persists native application sessions. Implementations for desktop and CLI applications should use the operating system credential store. The Go runtime never writes user credentials to disk itself.
type SignOutResult ¶
type SignOutResult = ChikSignOutResult
SignOutResult confirms that a session was revoked.
type Storage ¶
type Storage = ChikStorageClient
Storage provides application object storage operations.
type StorageCreateUploadInput ¶
type StorageCreateUploadInput = ChikStorageCreateUploadInput
StorageCreateUploadInput reserves an object upload.
type StorageDownloadInput ¶
type StorageDownloadInput = ChikStorageDownloadInput
StorageDownloadInput identifies an object download.
type StorageDownloadURL ¶
type StorageDownloadURL = ChikStorageDownloadURL
StorageDownloadURL is a temporary object download URL.
type StorageError ¶
type StorageError = ChikStorageAPIError
StorageError describes an application storage failure.
type StoragePublicURLInput ¶
type StoragePublicURLInput = ChikStoragePublicURLInput
StoragePublicURLInput identifies an object in a public bucket.
type StorageUpload ¶
type StorageUpload = ChikStorageUpload
StorageUpload controls one application object upload.
type StorageUploadCommitUnknownError ¶
type StorageUploadCommitUnknownError = ChikStorageUploadCommitUnknownError
StorageUploadCommitUnknownError means transfer completion was not confirmed.
type StreamDecoder ¶
type StreamDecoder = ChikStreamDecoder
StreamDecoder reads response-stream messages.
type StreamSender ¶
type StreamSender = ChikStreamSender
StreamSender sends request-stream messages.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package keyring은 operating system credential store를 사용하는 desktop 및 CLI session store를 제공합니다.
|
Package keyring은 operating system credential store를 사용하는 desktop 및 CLI session store를 제공합니다. |
|
Package server provides the public runtime contract used by generated Go servers.
|
Package server provides the public runtime contract used by generated Go servers. |