Documentation
¶
Index ¶
- func GetAbsolutePath(path string) (string, error)
- func IsSymlinkToDir(path string) bool
- func ReturnItem(item string) string
- type GroupItems
- type GroupsItemsSelector
- func (o *GroupsItemsSelector[I]) AddGroupItems(group string, items ...I)
- func (o *GroupsItemsSelector[I]) FindGroupsByItem(item I) (groups []string)
- func (o *GroupsItemsSelector[I]) FindGroupsByItemFirst(item I) (ret string)
- func (o *GroupsItemsSelector[I]) GetGroupAndItemByItemNumber(number int) (group string, item I, err error)
- func (o *GroupsItemsSelector[I]) HasGroup(group string) (ret bool)
- func (o *GroupsItemsSelector[I]) Print(shellCompleteList bool)
- type GroupsItemsSelectorString
- type OAuthStorage
- func (s *OAuthStorage) DeleteToken(provider string) error
- func (s *OAuthStorage) GetTokenPath(provider string) string
- func (s *OAuthStorage) HasValidToken(provider string, bufferMinutes int) bool
- func (s *OAuthStorage) LoadToken(provider string) (*OAuthToken, error)
- func (s *OAuthStorage) SaveToken(provider string, token *OAuthToken) error
- type OAuthToken
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAbsolutePath ¶
GetAbsolutePath resolves a given path to its absolute form, handling ~, ./, ../, UNC paths, and symlinks.
func IsSymlinkToDir ¶
Helper function to check if a symlink points to a directory
func ReturnItem ¶
Types ¶
type GroupItems ¶
func (*GroupItems[I]) ContainsItemBy ¶
func (o *GroupItems[I]) ContainsItemBy(predicate func(item I) bool) (ret bool)
func (*GroupItems[I]) Count ¶
func (o *GroupItems[I]) Count() int
type GroupsItemsSelector ¶
type GroupsItemsSelector[I any] struct { SelectionLabel string GetItemKey func(I) string GroupsItems []*GroupItems[I] }
func NewGroupsItemsSelector ¶
func NewGroupsItemsSelector[I any](selectionLabel string, getItemLabel func(I) string) *GroupsItemsSelector[I]
func (*GroupsItemsSelector[I]) AddGroupItems ¶
func (o *GroupsItemsSelector[I]) AddGroupItems(group string, items ...I)
func (*GroupsItemsSelector[I]) FindGroupsByItem ¶
func (o *GroupsItemsSelector[I]) FindGroupsByItem(item I) (groups []string)
func (*GroupsItemsSelector[I]) FindGroupsByItemFirst ¶
func (o *GroupsItemsSelector[I]) FindGroupsByItemFirst(item I) (ret string)
func (*GroupsItemsSelector[I]) GetGroupAndItemByItemNumber ¶
func (o *GroupsItemsSelector[I]) GetGroupAndItemByItemNumber(number int) (group string, item I, err error)
func (*GroupsItemsSelector[I]) HasGroup ¶
func (o *GroupsItemsSelector[I]) HasGroup(group string) (ret bool)
func (*GroupsItemsSelector[I]) Print ¶
func (o *GroupsItemsSelector[I]) Print(shellCompleteList bool)
type GroupsItemsSelectorString ¶
type GroupsItemsSelectorString struct {
*GroupsItemsSelector[string]
}
func NewGroupsItemsSelectorString ¶
func NewGroupsItemsSelectorString(selectionLabel string) *GroupsItemsSelectorString
type OAuthStorage ¶
type OAuthStorage struct {
// contains filtered or unexported fields
}
OAuthStorage handles persistent storage of OAuth tokens
func NewOAuthStorage ¶
func NewOAuthStorage() (*OAuthStorage, error)
NewOAuthStorage creates a new OAuth storage instance
func (*OAuthStorage) DeleteToken ¶
func (s *OAuthStorage) DeleteToken(provider string) error
DeleteToken removes a stored OAuth token
func (*OAuthStorage) GetTokenPath ¶
func (s *OAuthStorage) GetTokenPath(provider string) string
GetTokenPath returns the file path for a provider's OAuth token
func (*OAuthStorage) HasValidToken ¶
func (s *OAuthStorage) HasValidToken(provider string, bufferMinutes int) bool
HasValidToken checks if a valid (non-expired) token exists for a provider
func (*OAuthStorage) LoadToken ¶
func (s *OAuthStorage) LoadToken(provider string) (*OAuthToken, error)
LoadToken loads an OAuth token from disk
func (*OAuthStorage) SaveToken ¶
func (s *OAuthStorage) SaveToken(provider string, token *OAuthToken) error
SaveToken saves an OAuth token to disk with proper permissions
type OAuthToken ¶
type OAuthToken struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
ExpiresAt int64 `json:"expires_at"`
TokenType string `json:"token_type"`
Scope string `json:"scope"`
}
OAuthToken represents stored OAuth token information
func (*OAuthToken) IsExpired ¶
func (t *OAuthToken) IsExpired(bufferMinutes int) bool
IsExpired checks if the token is expired or will expire within the buffer time