Words typo in codes fixed.
This commit is contained in:
@ -94,8 +94,8 @@ func (relayConfig *RelayConfig) ServerHostname() *url.URL {
|
||||
return relayConfig.domain
|
||||
}
|
||||
|
||||
// ServerHostname is API Server's servername definition.
|
||||
func (relayConfig *RelayConfig) ServerServicename() string {
|
||||
// ServerServiceName is API Server's servername definition.
|
||||
func (relayConfig *RelayConfig) ServerServiceName() string {
|
||||
return relayConfig.serviceName
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ func (relayConfig *RelayConfig) ActorKey() *rsa.PrivateKey {
|
||||
return relayConfig.actorKey
|
||||
}
|
||||
|
||||
// CreateRedisClient is create new redis client from RelayConfig.
|
||||
// RedisClient is return redis client from RelayConfig.
|
||||
func (relayConfig *RelayConfig) RedisClient() *redis.Client {
|
||||
return relayConfig.redisClient
|
||||
}
|
||||
|
@ -81,15 +81,15 @@ func TestRelayConfig_ServerHostname(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRelayConfig_DumpWelcomeMessage(t *testing.T) {
|
||||
relayconfig := createRelayConfig(t)
|
||||
w := relayconfig.DumpWelcomeMessage("Testing", "")
|
||||
relayConfig := createRelayConfig(t)
|
||||
w := relayConfig.DumpWelcomeMessage("Testing", "")
|
||||
|
||||
informations := map[string]string{
|
||||
"module NAME": "Testing",
|
||||
"RELAY NANE": relayconfig.serviceName,
|
||||
"RELAY DOMAIN": relayconfig.domain.Host,
|
||||
"REDIS URL": relayconfig.redisURL,
|
||||
"BIND ADDRESS": relayconfig.serverBind,
|
||||
"RELAY NANE": relayConfig.serviceName,
|
||||
"RELAY DOMAIN": relayConfig.domain.Host,
|
||||
"REDIS URL": relayConfig.redisURL,
|
||||
"BIND ADDRESS": relayConfig.serverBind,
|
||||
}
|
||||
|
||||
for key, information := range informations {
|
||||
|
@ -45,8 +45,8 @@ type Actor struct {
|
||||
Image *Image `json:"image,omitempty"`
|
||||
}
|
||||
|
||||
// GenerateSelfKey : Generate relay Actor from Publickey.
|
||||
func (actor *Actor) GenerateSelfKey(hostname *url.URL, publickey *rsa.PublicKey) {
|
||||
// GenerateSelfKey : Generate relay Actor from PublicKey.
|
||||
func (actor *Actor) GenerateSelfKey(hostname *url.URL, publicKey *rsa.PublicKey) {
|
||||
actor.Context = []string{"https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1"}
|
||||
actor.ID = hostname.String() + "/actor"
|
||||
actor.Type = "Service"
|
||||
@ -55,7 +55,7 @@ func (actor *Actor) GenerateSelfKey(hostname *url.URL, publickey *rsa.PublicKey)
|
||||
actor.PublicKey = PublicKey{
|
||||
hostname.String() + "/actor#main-key",
|
||||
hostname.String() + "/actor",
|
||||
generatePublicKeyPEMString(publickey),
|
||||
generatePublicKeyPEMString(publicKey),
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,9 +195,9 @@ func (activity *Activity) NestedActivity() (*Activity, error) {
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
return nil, errors.New("Can't assart type")
|
||||
return nil, errors.New("can't assert type")
|
||||
}
|
||||
return nil, errors.New("Can't assart id")
|
||||
return nil, errors.New("can't assert id")
|
||||
}
|
||||
|
||||
// ActivityObject : ActivityPub Activity.
|
||||
@ -235,7 +235,7 @@ type WebfingerResource struct {
|
||||
func (resource *WebfingerResource) GenerateFromActor(hostname *url.URL, actor *Actor) {
|
||||
resource.Subject = "acct:" + actor.PreferredUsername + "@" + hostname.Host
|
||||
resource.Links = []WebfingerLink{
|
||||
WebfingerLink{
|
||||
{
|
||||
"self",
|
||||
"application/activity+json",
|
||||
actor.ID,
|
||||
@ -303,7 +303,7 @@ type NodeinfoMetadata struct {
|
||||
// GenerateFromActor : Generate Webfinger resource from Actor.
|
||||
func (resource *NodeinfoResources) GenerateFromActor(hostname *url.URL, actor *Actor, serverVersion string) {
|
||||
resource.NodeinfoLinks.Links = []NodeinfoLink{
|
||||
NodeinfoLink{
|
||||
{
|
||||
"http://nodeinfo.diaspora.software/ns/schema/2.1",
|
||||
"https://" + hostname.Host + "/nodeinfo/2.1",
|
||||
},
|
||||
|
@ -92,7 +92,7 @@ func (config *RelayState) Load() {
|
||||
config.Subscriptions = subscriptions
|
||||
}
|
||||
|
||||
// SetConfig : Set relay configration
|
||||
// SetConfig : Set relay configuration
|
||||
func (config *RelayState) SetConfig(key Config, value bool) {
|
||||
strValue := 0
|
||||
if value {
|
||||
|
@ -167,7 +167,7 @@ func TestLimitedDomain(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadCompatiSubscription(t *testing.T) {
|
||||
func TestLoadCompatibleSubscription(t *testing.T) {
|
||||
relayState.RedisClient.FlushAll().Result()
|
||||
|
||||
relayState.AddSubscription(Subscription{
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
"github.com/go-redis/redis"
|
||||
)
|
||||
|
||||
func ReadPublicKeyRSAfromString(pemString string) (*rsa.PublicKey, error) {
|
||||
func ReadPublicKeyRSAFromString(pemString string) (*rsa.PublicKey, error) {
|
||||
pemByte := []byte(pemString)
|
||||
decoded, _ := pem.Decode(pemByte)
|
||||
defer func() {
|
||||
|
Reference in New Issue
Block a user