etcd

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2021 License: MIT Imports: 8 Imported by: 0

README

Etcd Storage for OAuth 2.0

[![Build][Build-Status-Image]][Build-Status-Url] [![Codecov][codecov-image]][codecov-url] [![ReportCard][reportcard-image]][reportcard-url] [![GoDoc][godoc-image]][godoc-url] [![License][license-image]][license-url]

Install

$ go get -u -v github.com/ryicoh/go-oauth2-etcd

Usage

package main

import (
)

func main() {
}

MIT License

Copyright (c) 2020 Lyric

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenStore

type TokenStore struct {
	// contains filtered or unexported fields
}

TokenStore etcd token store

func NewEtcdStore

func NewEtcdStore(opts clientv3.Config, keyNamespace ...string) (*TokenStore, error)

NewEtcdStore create an instance of a etcd store

func NewEtcdStoreWithCli

func NewEtcdStoreWithCli(cli *clientv3.Client, keyNamespace ...string) *TokenStore

NewEtcdStoreWithCli create an instance of a etcd store

func (*TokenStore) Close

func (s *TokenStore) Close() error

Close close the store

func (*TokenStore) Create

func (s *TokenStore) Create(ctx context.Context, info oauth2.TokenInfo) error

Create Create and store the new token information

func (*TokenStore) GetByAccess

func (s *TokenStore) GetByAccess(ctx context.Context, access string) (oauth2.TokenInfo, error)

GetByAccess Use the access token for token information data

func (*TokenStore) GetByCode

func (s *TokenStore) GetByCode(ctx context.Context, code string) (oauth2.TokenInfo, error)

GetByCode Use the authorization code for token information data

func (*TokenStore) GetByRefresh

func (s *TokenStore) GetByRefresh(ctx context.Context, refresh string) (oauth2.TokenInfo, error)

GetByRefresh Use the refresh token for token information data

func (*TokenStore) RemoveByAccess

func (s *TokenStore) RemoveByAccess(ctx context.Context, access string) error

RemoveByAccess Use the access token to delete the token information

func (*TokenStore) RemoveByCode

func (s *TokenStore) RemoveByCode(ctx context.Context, code string) error

RemoveByCode Use the authorization code to delete the token information

func (*TokenStore) RemoveByRefresh

func (s *TokenStore) RemoveByRefresh(ctx context.Context, refresh string) error

RemoveByRefresh Use the refresh token to delete the token information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL