Versions in this module Expand all Collapse all v0 v0.5.0 Aug 31, 2026 Changes in this version + const EnvConfigDir + const EnvServer + const EnvToken + const MinServerVersion + var ErrLoginRequired = errors.New("로그인이 필요하다 — nullus login 을 실행하라") + func DeleteSession() error + func EnsureFreshToken(ctx context.Context, hc *http.Client) (string, error) + func ReadToken() (string, error) + func SaveSession(s Session) error + func SaveToken(token string) error + type APIError struct + Code string + Kind Kind + Message string + StatusCode int + TraceID string + func (e *APIError) Error() string + func (e *APIError) Unwrap() error + type AuthCodeFlow struct + func NewAuthCodeFlow(cfg OIDCConfig, ep OIDCEndpoints, redirectURI string) (*AuthCodeFlow, error) + func (f *AuthCodeFlow) AuthURL() string + func (f *AuthCodeFlow) Exchange(ctx context.Context, hc *http.Client, code, state string) (Session, error) + func (f *AuthCodeFlow) State() string + type Client struct + func New(cfg Config, opts ...Option) (*Client, error) + func (c *Client) CheckVersionSkew(ctx context.Context) (VersionSkew, error) + func (c *Client) Do(ctx context.Context, method, path string, in, out any) error + func (c *Client) ServerInfo(ctx context.Context) (ServerInfo, error) + type Config struct + Server string + Token string + func Load(explicit Config) (Config, error) + type Kind int + const KindAuth + const KindNotFound + const KindServer + const KindUsage + func (k Kind) ExitCode() int + func (k Kind) String() string + type OIDCConfig struct + ClientID string + Issuer string + Scopes []string + type OIDCEndpoints struct + Authorization string + Token string + func DiscoverOIDC(ctx context.Context, hc *http.Client, issuer string) (OIDCEndpoints, error) + type Option func(*Client) + func WithHTTPClient(hc *http.Client) Option + type ServerInfo struct + DB string + Status string + Version string + type Session struct + AccessToken string + ClientID string + Expiry time.Time + Issuer string + RefreshToken string + TokenEndpoint string + func ReadSession() (Session, bool, error) + func RefreshSession(ctx context.Context, hc *http.Client, s Session) (Session, error) + type VersionSkew struct + Compatible bool + MinSupported string + ServerVersion string