Documentation
¶
Index ¶
- func GetServiceAddress(servicesName string) (address string)
- type Accounts
- type Activity
- type Actor
- type Auth
- type Channel
- type Client
- type Config
- type CustomerTokenAuth
- type Devices
- type FS
- type Option
- type PerRPCCredentials
- type Public
- type Subscribe
- type Svc
- func (svc *Svc) AddDevice(accountId int64, userAgent string) (*pb.CreateResponse, error)
- func (svc *Svc) ArticleActivity(accountId, actorId, articleId int64, article *article.CreateRequest) (*pb.ActivityResponse, error)
- func (svc *Svc) CreateAccount(username, mail, password, publicKey string) (*pb.CreateResponse, error)
- func (svc *Svc) CreateActor(preferredUsername, publicKey, actorType string) (*pb.CreateResponse, error)
- func (svc *Svc) CreateFs(accountId int64, fileName, address string) (*pb.CreateResponse, error)
- func (svc *Svc) Delete(accountId int64, fileName string) (*pb.DeleteResponse, error)
- func (svc *Svc) DeleteActor(actorId int64) (*pb.DeleteResponse, error)
- func (svc *Svc) DeleteDevices(accountId int64) (*pb.DeleteDevicesResponse, error)
- func (svc *Svc) GetAccountByUsername(username string) (*pb.GetByUsernameResponse, error)
- func (svc *Svc) GetActor(actorId int64) (*pb.GetResponse, error)
- func (svc *Svc) GetActorByAddress(inbox string) (*pb.ActorData, error)
- func (svc *Svc) GetActorByUsername(username string) (*pb.ActorData, error)
- func (svc *Svc) GetFs(accountId int64, fileName string) (*pb.GetResponse, error)
- func (svc *Svc) GetInstance() (*pb.GetInstanceResponse, error)
- func (svc *Svc) GetPrivateKey(accountId int64) (*pb.GetPrivateKeyResponse, error)
- func (svc *Svc) GetPrivateKeyByActorId(actorId int64) (*pb.GetPrivateKeyByActorIdResponse, error)
- func (svc *Svc) GetSubscribers(channelId, adminId int64) (*pb.GetSubscribersResponse, error)
- func (svc *Svc) Inbox(name string, body []byte) (*pb.InboxResponse, error)
- func (svc *Svc) IsExistAccount(username string) (*pb.IsExistResponse, error)
- func (svc *Svc) IsExistActor(preferredUsername string) (*pb.IsExistResponse, error)
- func (svc *Svc) IsExistDevice(deviceId int64) (*pb.IsExistResponse, error)
- func (svc *Svc) IsRemoteExist(preferredUsername, domain string) (*pb.IsExistResponse, error)
- func (svc *Svc) SetAuthPublicKey(accountId int64, publicKey string) (*pb.SetPublicKeyResponse, error)
- func (svc *Svc) Verify(username, password string) (*pb.VerifyResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetServiceAddress ¶
GetServiceAddress receives the service name and returns the gRPC address. config provider is viper.
Types ¶
type Accounts ¶
type Accounts interface { IsExistAccount(username string) (*pb.IsExistResponse, error) GetAccountByUsername(username string) (*pb.GetByUsernameResponse, error) CreateAccount(username, mail, password, publicKey string) (*pb.CreateResponse, error) GetPrivateKey(accountId int64) (*pb.GetPrivateKeyResponse, error) Verify(username, password string) (*pb.VerifyResponse, error) }
type Activity ¶
type Activity interface { Inbox(name string, body []byte) (*pb.InboxResponse, error) ArticleActivity(accountId, actorId, articleId int64, article *article.CreateRequest) (*pb.ActivityResponse, error) }
type Actor ¶
type Actor interface { IsExistActor(preferredUsername string) (*pb.IsExistResponse, error) IsRemoteExist(preferredUsername, domain string) (*pb.IsExistResponse, error) GetActor(actorId int64) (*pb.GetResponse, error) GetActorByUsername(username string) (*pb.ActorData, error) GetActorByAddress(inbox string) (*pb.ActorData, error) CreateActor(preferredUsername, publicKey, actorType string) (*pb.CreateResponse, error) DeleteActor(actorId int64) (*pb.DeleteResponse, error) }
type Auth ¶
type Auth interface {
SetAuthPublicKey(accountId int64, publicKey string) (*pb.SetPublicKeyResponse, error)
}
type Channel ¶
type Channel interface {
GetPrivateKeyByActorId(actorId int64) (*pb.GetPrivateKeyByActorIdResponse, error)
}
type CustomerTokenAuth ¶
type CustomerTokenAuth struct{}
func (CustomerTokenAuth) GetRequestMetadata ¶
func (CustomerTokenAuth) RequireTransportSecurity ¶
func (c CustomerTokenAuth) RequireTransportSecurity() bool
type Devices ¶
type Devices interface { DeleteDevices(accountId int64) (*pb.DeleteDevicesResponse, error) AddDevice(accountId int64, userAgent string) (*pb.CreateResponse, error) IsExistDevice(deviceId int64) (*pb.IsExistResponse, error) }
type FS ¶
type FS interface { CreateFs(accountId int64, fileName, address string) (*pb.CreateResponse, error) GetFs(accountId int64, fileName string) (*pb.GetResponse, error) Delete(accountId int64, fileName string) (*pb.DeleteResponse, error) }
type Option ¶
type Option func(o *Config)
func SetDialOptionsWithToken ¶
func SetDialOptionsWithToken() Option
func SetDialTimeout ¶
type PerRPCCredentials ¶
type Public ¶
type Public interface {
GetInstance() (*pb.GetInstanceResponse, error)
}
type Subscribe ¶
type Subscribe interface {
GetSubscribers(channelId, adminId int64) (*pb.GetSubscribersResponse, error)
}
type Svc ¶
type Svc struct {
// contains filtered or unexported fields
}
func (*Svc) ArticleActivity ¶
func (svc *Svc) ArticleActivity(accountId, actorId, articleId int64, article *article.CreateRequest) (*pb.ActivityResponse, error)
func (*Svc) CreateAccount ¶
func (svc *Svc) CreateAccount(username, mail, password, publicKey string) (*pb.CreateResponse, error)
func (*Svc) CreateActor ¶
func (svc *Svc) CreateActor(preferredUsername, publicKey, actorType string) (*pb.CreateResponse, error)
func (*Svc) DeleteActor ¶
func (svc *Svc) DeleteActor(actorId int64) (*pb.DeleteResponse, error)
func (*Svc) DeleteDevices ¶
func (svc *Svc) DeleteDevices(accountId int64) (*pb.DeleteDevicesResponse, error)
func (*Svc) GetAccountByUsername ¶
func (svc *Svc) GetAccountByUsername(username string) (*pb.GetByUsernameResponse, error)
func (*Svc) GetActorByAddress ¶
func (*Svc) GetActorByUsername ¶
func (*Svc) GetInstance ¶
func (svc *Svc) GetInstance() (*pb.GetInstanceResponse, error)
func (*Svc) GetPrivateKey ¶
func (svc *Svc) GetPrivateKey(accountId int64) (*pb.GetPrivateKeyResponse, error)
func (*Svc) GetPrivateKeyByActorId ¶
func (svc *Svc) GetPrivateKeyByActorId(actorId int64) (*pb.GetPrivateKeyByActorIdResponse, error)
func (*Svc) GetSubscribers ¶
func (svc *Svc) GetSubscribers(channelId, adminId int64) (*pb.GetSubscribersResponse, error)
func (*Svc) IsExistAccount ¶
func (svc *Svc) IsExistAccount(username string) (*pb.IsExistResponse, error)
func (*Svc) IsExistActor ¶
func (svc *Svc) IsExistActor(preferredUsername string) (*pb.IsExistResponse, error)
func (*Svc) IsExistDevice ¶
func (svc *Svc) IsExistDevice(deviceId int64) (*pb.IsExistResponse, error)
func (*Svc) IsRemoteExist ¶
func (svc *Svc) IsRemoteExist(preferredUsername, domain string) (*pb.IsExistResponse, error)
func (*Svc) SetAuthPublicKey ¶
Click to show internal directories.
Click to hide internal directories.